示例#1
0
        public void Start()
        {
            //TODO Coroutine hide
            Core.Instance.GetService <UIManager>().ShowWindow(UIWindowEnum.SPLASH, false);

            ResetEarnedValues();



            if (TryesCount > 2)
            {
                _gameWindow.timerText.text = "";
                _playerCar.EnablePlayerControll(false);
                _enemyCar.carBase.EnableEnemyControll(false);
                _gameWindow.Show();
                CalculateResults();
            }
            else
            {
                var enemyName = (_playerManager.PlayerId == _gameData.player1_Id) ?
                                (_gameData.player2_name) : (_gameData.player1_name);
                //_gameWindow.textInfoWindow("Racing versus " + enemyName);

                _gameWindow.ShowEnemyMeters();
                _gameWindow.ActiveGold();
                _gameWindow.Show();

                _startTimer = Core.Instance.StartCor(StartTimer());
                EventManager._init.Game.TrackEvent.GetEvent.Invoke_Start();
            }
        }
示例#2
0
        public void Start()
        {
            //new



            _uiManager.ShowWindow(UIWindowEnum.SPLASH, false);
            _gameWindow.Show();
            //
            _gameData.IsFinishedRecord = 0;

            _recordObjectController.Init();
            _gameWindow.DeActiveJewels();


            //InitTimeInfo();
            _gameWindow.DeActiveGold();



            if (!_playerManager.TrackOpen.Contains(Convert.ToInt32(_gameData.track_id) + 1))
            {
                //coroutineStartTimeInfo = Core.Instance.StartCor(СheckTimeInfo());
            }

            Debug.Log("Tryes in Start " + _gameData.GetTryes);
            _coroutineStartTimer = Core.Instance.StartCor(
                StartTimer(
                    _gameWindow,

                    () => {
                if (_gameData.GetTryes <= 0)
                {
                    //_finishWindow.OnBuyTriesClick += BuyTries;

                    _playerCar.EnablePlayerControll(false);
                    CalculateResults();
                    if (_coroutineStartTimer != null)
                    {
                        Core.Instance.StopCor(_coroutineStartTimer);
                    }
                }

                _coroutineRecord = Core.Instance.StartCor(Record());
                if (_replayData.Count > 0)
                {
                    _coroutineGhost = Core.Instance.StartCor(MoveGhost());
                }
                EventManager._init.Game.TrackEvent.GetEvent.Invoke_Start();
            }
                    )
                );
        }