示例#1
0
        public void Init()
        {
            _uiManager = Core.Instance.GetService <UIManager>();
            Assert.AreNotEqual(null, _uiManager);

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

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

            _pauseWindow = _uiManager.GetWindow(UIWindowEnum.PAUSE_TUTORIAL) as PauseWindow;
            Assert.AreNotEqual(null, _pauseWindow);
        }
示例#2
0
        public void Init(GameData data)
        {
            //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_TUTORIAL) as GameWindowTutorial;
            Assert.AreNotEqual(null, _gameWindow);

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

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

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

            _trigersTutorial = _uiManager.GetWindow(UIWindowEnum.TRIGERS_TUTORIAL) as TrigersTutorial;
            Assert.AreNotEqual(null, _trigersTutorial);

            _audioService = Core.Instance.GetService <AudioService>();
            Assert.AreNotEqual(null, _audioService);

            _uiManager.ShowWindow(UIWindowEnum.SPLASH, false);

            //
            _gameData = data;
            _uiManager.ShowWindow(UIWindowEnum.SPLASH, true);
            _gameManager.LoadTrack(OnTrackLoaded);
        }
示例#3
0
        private void Init_Tutorial_Game()
        {
            _gameWindowsTutorial = GetComponentInChildren <_Tutorial.GameWindowTutorial>();
            Assert.AreNotEqual(null, _gameWindowsTutorial);

            _pauseWindowTutorial = GetComponentInChildren <_Tutorial.PauseWindow>();
            Assert.AreNotEqual(null, _pauseWindowTutorial);

            _finishWindowTutorial = GetComponentInChildren <_Tutorial.FinishWindow>();
            Assert.AreNotEqual(null, _finishWindowTutorial);

            _retryWindowTutorial = GetComponentInChildren <_Tutorial.RetryWindow>();
            Assert.AreNotEqual(null, _retryWindowTutorial);

            _chooseCarTutorial = GetComponentInChildren <_Tutorial.ChooseCarTutorialWindow>();
            Assert.AreNotEqual(null, _chooseCarTutorial);

            _trigersTutorial = GetComponentInChildren <_Tutorial.TrigersTutorial>();
            Assert.AreNotEqual(null, _trigersTutorial);
        }
示例#4
0
        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);

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

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

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

            _chooseCarTutorial = _uiManager.GetWindow(UIWindowEnum.CHOOSE_CAR_TUTORIAL) as ChooseCarTutorialWindow;
            Assert.AreNotEqual(null, _chooseCarTutorial);

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

            _trigersTutorial = _uiManager.GetWindow(UIWindowEnum.TRIGERS_TUTORIAL) as TrigersTutorial;
            Assert.AreNotEqual(null, _trigersTutorial);
            //_chooseCarTutorial.Show();

            // -------------------------------------------
            //
            _mainScreenStateManager.SwitchState(MainScreenStatesEnum.GAME_TUTORIAL);


            _gameWindowTutorial.OnPauseClick += Pause;
            _pauseWindow.OnResumeClick       += Resume;

            _gameWindowTutorial.OnPauseClick += Core.Instance.Mute;
            _pauseWindow.OnResumeClick       += Core.Instance.UnMute;
            _pauseWindow.OnMenuClick         += Core.Instance.UnMute;
            _pauseWindow.OnCoiseAnyCar       += Core.Instance.UnMute;
            _pauseWindow.OnRestartClick      += Core.Instance.UnMute;

            _chooseCarTutorial.OnClickBuggy += clickBuggy;
            _chooseCarTutorial.OnClickJeep  += clickJeep;
            _chooseCarTutorial.OnClickRally += clickRally;


            _finishWindow.NExtTrack  += NextTrack;
            _pauseWindow.OnMenuClick += Menu;
            // // -------------------------------------------

            // _uiManager.ShowWindow(UIWindowEnum.SPLASH, true);


            _uiManager.ShowWindow(UIWindowEnum.SPLASH, false);


            _uiManager.ShowWindow(UIWindowEnum.HEADER, false);


            if (_playerManager.GetTutorialStep() < 3)
            {
                _trigersTutorial.Show();
                _chooseCarTutorial.Show();
            }
            else if (_playerManager.GetTutorialStep() == 3)
            {
                Menu();
            }
        }