Пример #1
0
        private void Start()
        {
            _drawAssistant = UIMainController.Instance.CurrentDrawer;
            UIMainController.SetScore(_score);

            _drawAssistant.OnEndDraw += CheckCompleteLevel;

            _previewWindow = UIMainController.GetWindowById(Constants.UI_PREVIEW_WINDOW);
        }
Пример #2
0
        public void StartGame()
        {
            _score        = 0;
            _currentLevel = 1;
            _levelTime    = _levelStartTime;

            UIMainController.SetScore(_score);

            StartCoroutine(StartCurrentLevel());
        }
Пример #3
0
        public IEnumerator TimeLeft(float timeLeft = 30.0f)
        {
            while (timeLeft > 0)
            {
                timeLeft -= Time.deltaTime;

                UIMainController.SetTimer(timeLeft);
                yield return(null);
            }

            StopGame();
        }
Пример #4
0
        private IEnumerator CompleteRoutine()
        {
            if (_timerLeftRoutine != null)
            {
                StopCoroutine(_timerLeftRoutine);
            }
            _currentLevel++;
            _score++;
            _levelTime -= _timePerLevelDelta;
            yield return(new WaitForSeconds(0.5f));

            UIMainController.SetScore(_score);
            yield return(StartCoroutine(StartCurrentLevel()));
        }
Пример #5
0
        public void StopGame()
        {
            _drawAssistant.StopDraw();
            _drawAssistant.Clear();
            UIMainController.HideGameInfo();

            _previewWindow.CloseWindow();

            var endWindow = UIMainController.GetWindowById(Constants.UI_END_GAME_WINDOW);

            if (endWindow != null)
            {
                endWindow.ShowWindow();
            }
        }
Пример #6
0
        public void ToMenu()
        {
            CloseWindow();

            UIMainController.ShowButtons();
        }