예제 #1
0
    public void OnExitButtonClicked()
    {
        if (_loading != null)
        {
            return;
        }

        if (_gameController.QuickExit())
        {
            _gameController.Finish();
            _loading = SceneManager.LoadSceneAsync(Scenes.MainMenu);
            _animator.Play(UIAnimations.RightClosing);
            _loading.allowSceneActivation = false;
        }
        else
        {
            if (_gameController is IStorable)
            {
                _exitWindowWithSaving.Open();
            }
            else
            {
                _simpleExitWindow.Open();
            }
        }
    }
예제 #2
0
 public void OnUpgradesButtonClicked()
 {
     settingsWindow.Close();
     if (upgradesWindow.isOpen())
     {
         upgradesWindow.Close();
         EventManager.onGameResumed.Invoke();
     }
     else
     {
         EventManager.onGamePaused.Invoke();
         upgradesWindow.Open();
     }
 }