예제 #1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("Block") && !gameOver)
     {
         PointerUp();  //Finishes the game here to stoping holding behaviour
         gameOver = true;
         guiController.CloseRealtimeScoreText();
         guiController.SetScoreText(score);
         if (PlayerPrefs.HasKey("HighScore"))
         {
             float highestScore = PlayerPrefs.GetFloat("HighScore");
             if (score > highestScore)
             {
                 highestScore = score;
             }
             SetHighScore(highestScore);
         }
         else
         {
             SetHighScore(score);
         }
         guiController.OpenGameOverPanel();
     }
 }