private void Start() { _drawAssistant = UIMainController.Instance.CurrentDrawer; UIMainController.SetScore(_score); _drawAssistant.OnEndDraw += CheckCompleteLevel; _previewWindow = UIMainController.GetWindowById(Constants.UI_PREVIEW_WINDOW); }
public void StartGame() { _score = 0; _currentLevel = 1; _levelTime = _levelStartTime; UIMainController.SetScore(_score); StartCoroutine(StartCurrentLevel()); }
public IEnumerator TimeLeft(float timeLeft = 30.0f) { while (timeLeft > 0) { timeLeft -= Time.deltaTime; UIMainController.SetTimer(timeLeft); yield return(null); } StopGame(); }
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())); }
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(); } }
public void ToMenu() { CloseWindow(); UIMainController.ShowButtons(); }