Ejemplo n.º 1
0
        private void Init_Gameplay_Singleplayer()
        {
            _gameWindowSingleplayer = GetComponentInChildren <_Single.GameWindowSingleplayer>();
            Assert.AreNotEqual(null, _gameWindowSingleplayer);

            //
            _pauseWindowSingle = GetComponentInChildren <_Single.PauseWindow>();
            Assert.AreNotEqual(null, _pauseWindowSingle);

            _finishWindowSingle = GetComponentInChildren <_Single.FinishWindow>();
            Assert.AreNotEqual(null, _finishWindowSingle);

            _retryWindowSingle = GetComponentInChildren <_Single.RetryWindow>();
            Assert.AreNotEqual(null, _retryWindowSingle);
        }
Ejemplo n.º 2
0
        // I_STATE

        public void Enable()
        {
            _gameManager = Core.Instance.GetService <GameManager>();
            Assert.AreNotEqual(null, _gameManager);

            _statesManager = Core.Instance.GetService <StatesManager>();
            Assert.AreNotEqual(null, _statesManager);

            //
            _uiManager = Core.Instance.GetService <UIManager>();
            Assert.AreNotEqual(null, _uiManager);

            _mainScreenStateManager = _uiManager.Get_MainScreenStateManager();
            Assert.AreNotEqual(null, _mainScreenStateManager);

            _gameWindowSingleplayer = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_SINGLE) as GameWindowSingleplayer;
            Assert.AreNotEqual(null, _gameWindowSingleplayer);

            _pauseWindow = _uiManager.GetWindow(UIWindowEnum.PAUSE_SINGLE) as PauseWindow;
            Assert.AreNotEqual(null, _pauseWindow);

            //
            _gameManager.CreateGameHandler();

            //
            _objBackground = GameObject.FindGameObjectWithTag("BG");
            Assert.AreNotEqual(null, _objBackground);

            _objBackground.SetActive(false);

            // -------------------------------------------
            //
            _gameWindowSingleplayer.OnPauseClick += Pause;
            //_pauseWindow.OnResumeClick += Resume;
            ///_pauseWindow.OnMenuClick += Menu;
            // -------------------------------------------

            _uiManager.ShowWindow(UIWindowEnum.SPLASH, true);
            _mainScreenStateManager.SwitchState(MainScreenStatesEnum.GAME_SINGLE);
        }
Ejemplo n.º 3
0
        // I_HANDLER

        #region I_HANDLER_INTERFACES

        public void Init(GameData data)
        {
            Debug.Log("INIT >>> SINGLE HANDLER");

            //pre-conditions
            Assert.AreNotEqual(null, data);

            _carConstructor = Core.Instance.GetService <CarConstructor>();
            Assert.AreNotEqual(null, _carConstructor);

            _gameManager = Core.Instance.GetService <GameManager>();
            Assert.AreNotEqual(null, _gameManager);

            _playerManager = Core.Instance.GetService <PlayerManager>();
            Assert.AreNotEqual(null, _playerManager);

            _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>();
            Assert.AreNotEqual(null, _safePlayerPrefs);

            //
            _uiManager = Core.Instance.GetService <UIManager>();
            Assert.AreNotEqual(null, _uiManager);

            _gameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_SINGLE) as GameWindowSingleplayer;
            Assert.AreNotEqual(null, _gameWindow);

            _pauseWindow = _uiManager.GetWindow(UIWindowEnum.PAUSE_SINGLE) as PauseWindow;
            Assert.AreNotEqual(null, _pauseWindow);

            _retryWindow = _uiManager.GetWindow(UIWindowEnum.RETRY_SINGLE) as RetryWindow;
            Assert.AreNotEqual(null, _retryWindow);

            _finishWindow = _uiManager.GetWindow(UIWindowEnum.FINISH_SINGLE) as FinishWindow;
            Assert.AreNotEqual(null, _finishWindow);

            //
            _gameData = data;
            _gameManager.LoadTrack(OnTrackLoaded);
        }