/**
  * Called every frame update
  */
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape) == true)
     {
         Application.Quit();
     }
     if (this.levelController.isTimeOut())
     {
         float highScore = HighScoreStorage.GetHighScore();
         if (pickupScore >= highScore)
         {
             winText.text = "Congratulations! High score: " + pickupScore;
             if (pickupScore != highScore)
             {
                 HighScoreStorage.SetHighScore(pickupScore);
             }
         }
         else
         {
             winText.text = "Out of Time! Your score was: " + pickupScore;
         }
     }
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     text      = gameObject.GetComponent <Text>();
     text.text = HighScoreStorage.GetHighScore().ToString();
 }