示例#1
0
        // I_UI_WINDOW

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

            _gameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as GameWindowAsyncMultiplayer;
            Assert.AreNotEqual(null, _gameWindow);
            TimeBuy.DOFillAmount(1, 0f);
            //
            AssertVariables();
        }
示例#2
0
        // I_UI_WINDOW

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

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

            _smileSwapHandler = new SmileSwapHandler();

            //
            AssertSerializedFields();
        }
示例#3
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);
        }
        // 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);
        }
示例#5
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);
        }
示例#6
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);
        }