Пример #1
0
        // I_UI_WINDOW

        public void Init()
        {
            base.InitVariables();

            _gameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_SINGLE) as GameWindowSingleplayer;
            Assert.AreNotEqual(null, _gameWindow);
        }
Пример #2
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);
        }
Пример #3
0
        // METHODS

        private void InitVariables()
        {
            _uiManager = Core.Instance.GetService <UIManager>();
            Assert.AreNotEqual(null, _uiManager);

            _multiplayerWindow = _uiManager.GetWindow(UIWindowEnum.MAIN_MULTIPLAYER) as MultiplayerWindow;
            Assert.AreNotEqual(null, _multiplayerWindow);

            _chooseCarWindow = _uiManager.GetWindow(UIWindowEnum.CHOOSE_CAR) as ChooseCarWindow;
            Assert.AreNotEqual(null, _chooseCarWindow);

            _treeWindow = _uiManager.GetWindow(UIWindowEnum.TREE_UPGRADE) as TreeWindow;
            Assert.AreNotEqual(null, _treeWindow);

            _settingsWindow = _uiManager.GetWindow(UIWindowEnum.SETTINGS) as SettingsWindow;
            Assert.AreNotEqual(null, _settingsWindow);

            _chooseTrackWindow = _uiManager.GetWindow(UIWindowEnum.CHOOSE_TRACK) as ChooseTrackWindow;
            Assert.AreNotEqual(null, _chooseTrackWindow);

            //
            _gameWindowAsync = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as _AsyncMulty.GameWindowAsyncMultiplayer;
            Assert.AreNotEqual(null, _gameWindowAsync);

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

            // tutorial

            _gameWindowTutorial = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_TUTORIAL) as _Tutorial.GameWindowTutorial;
            Assert.AreNotEqual(null, _gameWindowTutorial);

            _statisticPanel = _uiManager.GetWindow(UIWindowEnum.STATISTIC) as StatisticPanel;
            Assert.AreNotEqual(null, _statisticPanel);

            _scorePanel = _uiManager.GetWindow(UIWindowEnum.SCORE) as ScorePanel;
            Assert.AreNotEqual(null, _scorePanel);

            _eventWindow = _uiManager.GetWindow(UIWindowEnum.EVENT) as EventWindow;
            Assert.AreNotEqual(null, _eventWindow);
        }
Пример #4
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);
        }
Пример #5
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);
        }