void OnGameStateChange(GameController.GameStateEvent eventInfo) { if (GameController.GameState.PLAYING == eventInfo.currentState) { //-- Start spawn loops when game starts StartCoroutine(SpawnLoop()); } }
void OnGameStateChange(GameController.GameStateEvent eventInfo) { if (GameController.instance.IsGamePlaying()) { StartCoroutine(AddTimerPoints()); } else if (GameController.GameState.GAME_OVER == eventInfo.currentState) { //-- This part uses getters to ignore fractions because // the player can't see those int oldBestScore = bestScore; int sessionScore = totalScore; if (oldBestScore < sessionScore) { m_PreviousBestScore = m_BestScore; m_BestScore = sessionScore; } } }
void OnGameStateChange(GameController.GameStateEvent eventInfo) { switch (eventInfo.currentState) { case GameController.GameState.PLAYING: { m_Body.gravityScale = m_NativeGravityScale; break; } case GameController.GameState.GAME_OVER: { m_DisableInput = true; m_Body.gravityScale = 0.0f; m_Body.velocity = Vector2.zero; break; } } }
void OnGameStateChange(GameController.GameStateEvent eventInfo) { switch (eventInfo.currentState) { case GameController.GameState.GAME_OVER: case GameController.GameState.TITLE_SCREEN: { //-- Don't scroll on title or game over m_CurrentScrollSpeed = 0.0f; break; } case GameController.GameState.PLAYING: { //-- Reset scrolling on playing ResetScrollSpeed(); break; } } }
void OnGameStateChange(GameController.GameStateEvent eventInfo) { UpdateGameUI(eventInfo.currentState); }