//added
 public void TakeDamage(int amount)
 {
     currentHealth -= amount;
     healthBar.SetHealth(currentHealth);
     if (currentHealth <= 0)
     {
         Die();
     }
 }
Esempio n. 2
0
 /////////////////////////////////
 ///   Damage Update Function  ///
 /////////////////////////////////
 public void TakeDamage(int damage)
 {
     currentHealth -= damage;
     healthBar.SetHealth(currentHealth);
 }