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; } }
public void SetGameState(GameEnum.GameState gameState) { _currentGameState = gameState; if (onGameStateChange != null) { onGameStateChange(_currentGameState); } }
public void PushGameState(GameEnum.GameState state) { if (_gameStateStack != null) { _gameStateStack.Push(state); GameManager.instance.SetGameState(state); } }