Esempio n. 1
0
 public void onRabbitDeath(HeroRabbit rabbit)
 {
     if (lives > 0)
     {
         rabbit.PlayDeathSound();
         Image crystImg = GameObject.Find("Heart" + lives).GetComponent <Image>();
         crystImg.sprite = EmptyHeart;
         --lives;
         rabbit.transform.position = this.startingPosition;
         rabbit.Live();
     }
     else
     {
         lives   = 3;
         Coins.n = 0;
         Coins.Refresh();
         Fruit.n = 0;
         Fruit.Refresh();
         Crystal.Clean();
         for (int i = 1; i < 4; i++)
         {
             Image crystImg = GameObject.Find("NonCrystal" + i).GetComponent <Image>();
             crystImg.sprite = EmptyCrystal;
         }
         LoseLevel.Instance.Show();
     }
 }