void OnGameOver(GameOverEvent evt) { // Disable input when the game is over. m_MinifigController.SetInputEnabled(false); // If we have won, turn to the camera and do a little celebration! if (evt.Win) { m_MinifigController.TurnTo(Camera.main.transform.position); var randomCelebration = Random.Range(0, 3); switch (randomCelebration) { case 0: { m_MinifigController.PlaySpecialAnimation(MinifigController.SpecialAnimation.AirGuitar); break; } case 1: { m_MinifigController.PlaySpecialAnimation(MinifigController.SpecialAnimation.Flexing); break; } case 2: { m_MinifigController.PlaySpecialAnimation(MinifigController.SpecialAnimation.Dance); break; } } } }
void OnGameStateChangeEvent(GameStateChangeEvent evt) { // Only enable input if game state is play. m_MinifigController.SetInputEnabled(evt.NewGameState == GameState.Play); // If we have won, turn to the camera and do a little celebration! if (evt.CurrentGameState == GameState.Play && evt.NewGameState == GameState.Win) { m_MinifigController.TurnTo(Camera.main.transform.position); var randomCelebration = Random.Range(0, 3); switch (randomCelebration) { case 0: { m_MinifigController.PlaySpecialAnimation(MinifigController.SpecialAnimation.AirGuitar); break; } case 1: { m_MinifigController.PlaySpecialAnimation(MinifigController.SpecialAnimation.Flexing); break; } case 2: { m_MinifigController.PlaySpecialAnimation(MinifigController.SpecialAnimation.Dance); break; } } } }