Example #1
0
        // CONSTRUCTOR

        public ReplayHandler()
        {
            _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>();
            _carConstructor  = Core.Instance.GetService <CarConstructor>();
            _gameManager     = Core.Instance.GetService <GameManager>();
            _playerManager   = Core.Instance.GetService <PlayerManager>();
            _uiManager       = Core.Instance.GetService <UIManager>();
            _finishWindow    = _uiManager.GetWindow(UIWindowEnum.FINISH_ASYNC) as FinishWindow;
            _pauseWindow     = _uiManager.GetWindow(UIWindowEnum.PAUSE_ASYNC) as PauseWindow;
            _gameWindow      = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as GameWindowAsyncMultiplayer;
            _retryWindow     = _uiManager.GetWindow(UIWindowEnum.RETRY_ASYNC) as RetryWindow;


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

            _statisticsService = Core.Instance.GetService <StatisticsService>();
            Assert.AreNotEqual(null, _statisticsService);
        }
Example #2
0
        private void Init_Gameplay_AsyncMultilpayer()
        {
            _gameWindow = GetComponentInChildren <_AsyncMulty.GameWindowAsyncMultiplayer>();
            Assert.AreNotEqual(null, _gameWindow);

            //
            _pauseWindow = GetComponentInChildren <_AsyncMulty.PauseWindow>();
            Assert.AreNotEqual(null, _pauseWindow);

            _finishWindow = GetComponentInChildren <_AsyncMulty.FinishWindow>();
            Assert.AreNotEqual(null, _finishWindow);

            _retryWindow = GetComponentInChildren <_AsyncMulty.RetryWindow>();
            Assert.AreNotEqual(null, _retryWindow);

            _recordFinishPanel = GetComponentInChildren <_AsyncMulty.RecordFinishPanel>();
            Assert.AreNotEqual(null, _recordFinishPanel);

            _crashFinishWindow = GetComponentInChildren <_AsyncMulty.CrashFinishWindow>();
            Assert.AreNotEqual(null, _crashFinishWindow);
        }
Example #3
0
        // I_HANDLER

        #region I_HANDLER_INTERFACES

        public void Init(GameData data)
        {
            GameDataManager._init.SetGameData(data);
            _gameData = GameDataManager._init.GameData;
            EventManager._init.Game.TrackEvent.GetEvent.Invoke_Awake();
            #region Init
            //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);

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

            _gameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as GameWindowAsyncMultiplayer;
            Assert.AreNotEqual(null, _gameWindow);

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

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

            _crashFinishWindow = _uiManager.GetWindow(UIWindowEnum.CRASH_FINISH_ASYNC) as CrashFinishWindow;
            Assert.AreNotEqual(null, _crashFinishWindow);

            _recordFinishPanel = _uiManager.GetWindow(UIWindowEnum.RECORD_FINISH_ASYNC) as RecordFinishPanel;
            Assert.AreNotEqual(null, _recordFinishPanel);

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

            _stasticService = Core.Instance.GetService <StatisticsService>();
            Assert.AreNotEqual(null, _stasticService);

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

            _replyObjectController = Core.Instance.GetService <ReplyObjectController>();



            _aBaseGameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as ABaseGameWindow;

            #endregion
            if (_gameData.GetTryes == 0 && _gameData.GameType != GameTypeEnum.MultyNew)
            {
                int TryesCount = _safePlayerPrefs.GetTryse(_gameData.gameId);
                _safePlayerPrefs.ChangeTryse(TryesCount, _gameData.gameId);
            }


            _gameWindow.InitGameData(_gameData);
            _gameManager.LoadTrack(OnTrackLoaded);
        }