예제 #1
0
    void OnChangeGameState(GameEnum.GameState gameState)
    {
        switch (gameState)
        {
        case GameEnum.GameState.Idle:
            GameUiVisibilityHandler.instance.SetMainGameUI();
            break;

        case GameEnum.GameState.Running:
            GameUiVisibilityHandler.instance.SetOnGameUI();
            UiManager.instance.SetUIState(GameEnum.UiState.GameRunningState);
            break;

        case GameEnum.GameState.PauseGame:
            UiManager.instance.SetUIState(GameEnum.UiState.PauseGameState);
            GameUiVisibilityHandler.instance.SetMainGameUI();
            break;

        case GameEnum.GameState.PlayerWin:
        case GameEnum.GameState.PlayerLose:
            SetUIState(GameEnum.UiState.GameOverState);
            GameUiVisibilityHandler.instance.SetGameOverUI();
            break;

        case GameEnum.GameState.StoreUiState:
            GameUiVisibilityHandler.instance.SetStorerUI();
            break;

        case GameEnum.GameState.LevelChoose:
            GameUiVisibilityHandler.instance.SetChooseLevelUI();
            break;
        }
    }
예제 #2
0
 public void SetGameState(GameEnum.GameState gameState)
 {
     _currentGameState = gameState;
     if (onGameStateChange != null)
     {
         onGameStateChange(_currentGameState);
     }
 }
예제 #3
0
 public void PushGameState(GameEnum.GameState state)
 {
     if (_gameStateStack != null)
     {
         _gameStateStack.Push(state);
         GameManager.instance.SetGameState(state);
     }
 }