Beispiel #1
0
        private void Start()
        {
            _drawAssistant = UIMainController.Instance.CurrentDrawer;
            UIMainController.SetScore(_score);

            _drawAssistant.OnEndDraw += CheckCompleteLevel;

            _previewWindow = UIMainController.GetWindowById(Constants.UI_PREVIEW_WINDOW);
        }
Beispiel #2
0
        public void StartGame()
        {
            _score        = 0;
            _currentLevel = 1;
            _levelTime    = _levelStartTime;

            UIMainController.SetScore(_score);

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

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

            StopGame();
        }
Beispiel #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()));
        }
Beispiel #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();
            }
        }
Beispiel #6
0
        public void ToMenu()
        {
            CloseWindow();

            UIMainController.ShowButtons();
        }