Exemple #1
0
 public void UsePotion()
 {
     if (obj.potions > 0 && Input.GetKeyDown(KeyCode.H) && this.life > 0)
     {
         cooldown_HealTime = 0.3f;
         sr.color          = new Color(0, 255, 0);
         obj.AddPotions(-1);
         n_potions.text = obj.potions.ToString();
         if (Mathf.Abs(life - maxLife) >= 30)
         {
             this.life += 30;
         }
         else
         {
             this.life += Mathf.Abs(life - maxLife);
         }
     }
 }