示例#1
0
 void Awake()
 {
     if (appController == null)
     {
         appController = this;
     }
     else if (appController != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
示例#2
0
        void loadGames()
        {
            JSONArray gamesObj = JSON.Parse(Resources.Load <TextAsset>("Jsons/games").text).AsObject["games"].AsArray;

            icons = Resources.LoadAll <Sprite>("Sprites/icons");

            games = new List <Game>();
            foreach (JSONClass game in gamesObj)
            {
                Game newGame = new Game();
                newGame.SetId(int.Parse(game["id"].Value));
                newGame.SetName(game ["name"].Value);
                newGame.SetPrefabName(game ["prefabName"].Value);
                newGame.SetDescription(game ["description"].Value);
                newGame.SetIcon(icons[int.Parse(game ["icon"].Value)]);
                games.Add(newGame);
            }

            AppController.GetController().GetMetricsController().SetMetricsModel(new MetricsModel(games));
        }
示例#3
0
 void Awake()
 {
     if (appController == null) appController = this;
     else if (appController != this) Destroy(gameObject);
     DontDestroyOnLoad(gameObject);
     appModel = new AppModel();
     //InitModelFromJsonInfo();
 }
示例#4
0
 internal void StartGame(int currentLevel)
 {
     AppController.GetController().SetCurrentGame(currentLevel);
     ChangeCurrentObject(readTest);
 }
示例#5
0
        internal void RestartCurrentGame()
        {
//			ChangeCurrentObject(LoadPrefab("oading");
            ChangeCurrentObject(LoadPrefab("Games/" + AppController.GetController().GetCurrentGame().GetPrefabName()));
        }