public void ChangeGameState(Systems.GameState.State newState) { if (OnGameStateChanged != null) { OnGameStateChanged(newState); } }
private void SetHudElementsState(Systems.GameState.State currentState) { switch (currentState) { case Systems.GameState.State.PLAY: m_PauseButton.gameObject.SetActive(true); m_AddCoinsButton.gameObject.SetActive(false); m_TurnsIndicator.transform.parent.gameObject.SetActive(true); m_PointsIndicator.gameObject.SetActive(true); break; case Systems.GameState.State.GAME_OVER: case Systems.GameState.State.PAUSE: case Systems.GameState.State.REWARDING: m_PauseButton.gameObject.SetActive(false); m_AddCoinsButton.gameObject.SetActive(true); m_TurnsIndicator.transform.parent.gameObject.SetActive(false); m_PointsIndicator.gameObject.SetActive(false); break; } }
private void SetWindowsState(Systems.GameState.State currentState) { switch (currentState) { case Systems.GameState.State.PLAY: break; case Systems.GameState.State.GAME_OVER: m_GameOverWindow.SetActive(true); Systems.GameState.Instance.UpdateBestScore(); break; case Systems.GameState.State.PAUSE: Systems.GameState.Instance.UpdateBestScore(); m_PauseWindow.SetActive(true); break; case Systems.GameState.State.REWARDING: m_ClaimPrizeWindow.SetActive(true); break; } }
void OnGameStateChanged(Systems.GameState.State newState) { SetHudElementsState(newState); SetWindowsState(newState); }