示例#1
0
        private void Init()
        {
            // Init Services
            services.Init();
            services.SetLanguageCode(gameData.languageCode);
            services.LoadLocalisationService();

            // Load Play Controller
            GameObject playControllerObject = Instantiate(gameObjectFactory.prefabPlayController);

            playControllerObject.SetActive(true);

            PlayController playController = playControllerObject.GetComponent <PlayController>();

            playController.Load();

            PlayController.main.ResetGameData();

            // Load Result Controller
            GameObject resultControllerObject = Instantiate(gameObjectFactory.prefabResultController);

            resultControllerObject.SetActive(true);

            ResultController resultController = resultControllerObject.GetComponent <ResultController>();

            resultController.Load();

            // inject factory to states
            gameLoad.gameObjectFactory  = gameObjectFactory;
            playEnter.gameObjectFactory = gameObjectFactory;

            // load
            gameLoad.OnLoadComplete += OnLoadComplete;
            gameLoad.Enter();
        }
        public void Load()
        {
            main = this;

            GameObjectFactory gameObjectFactory = GameObjectFactory.main;

            gameOverPanelObject = gameObjectFactory.gameOverPanelObject;
            congratsPanelObject = gameObjectFactory.congratsPanelObject;
        }