Beispiel #1
0
 public void GameOver()
 {
     if (!m_gameOver)
     {
         m_gameOver = true;
         GameSlowMo = false;
         SoundManager.Instance.BellRing(AudioSource);
         gameHUD.Hide();
         CancelInvoke();
         gameOverScreen.SetPlayerScore(scoreCounter.Points);
         if (scoreCounter.Points > GameDataManager.Instance.HighScore)
         {
             Instantiate(ResourceManager.Instance.HighScoreConfetti,
                         new Vector3(player.transform.position.x,
                                     35,
                                     0),
                         Quaternion.Euler(-90, 0, 0));
             GameDataManager.Instance.SetHighScore(scoreCounter.Points);
             SoundManager.Instance.CrowdCheer(AudioSource);
         }
         gameOverScreen.SetHighScore(GameDataManager.Instance.HighScore);
         gameOverScreen.Show();
     }
 }