public void OnExitPress()
 {
     if (!this.player.isDead)
     {
         ValuesManager.SaveCoins();
     }
     Application.Quit();
 }
 private void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.CompareTag("Laser"))
     {
         if (!isDead)
         {
             this.mainAudioSrc.PlayOneShot(this.laserZapSound);
         }
         isDead = true;
         ValuesManager.SaveCoins();
         ValuesManager.SaveScore();
     }
     else if (collider.CompareTag("Coin"))
     {
         Destroy(collider.gameObject);
         this.mainAudioSrc.PlayOneShot(this.collectCoinSound);
         ValuesManager.AddCoin();
         this.ui.UpdateCoinsText();
     }
 }
 public void OnRestartPress()
 {
     ValuesManager.SaveCoins();
     ValuesManager.currentCoins = 0;
     Application.LoadLevel(Application.loadedLevel);
 }