Пример #1
0
 public void UsingMana(float manaUsed)
 {
     ResetWaitTime();
     if (mana > 0)
     {
         mana -= manaUsed;
         manaBar.UpdateValue(mana, maxMana);
     }
 }
Пример #2
0
 public void ApplyDamage(float totalDamage)
 {
     health -= totalDamage;
     healthBar.UpdateValue(health, maxHealth);
     if (health <= 0)
     {
         Kill();
     }
 }
Пример #3
0
 public void GainEnergy(float amount)
 {
     if (energy < 100)
     {
         energy += amount;
         energyBar.UpdateValue(energy, 100);
     }
 }
Пример #4
0
 public void TakeDamage(float amount)
 {
     if (health <= 0f && !dying)
     {
         Die();
     }
     else
     {
         health -= amount;
         healthBar.UpdateValue(health, maxHealth);
     }
 }