Ejemplo n.º 1
0
 public override void TakeDamage(int amount)
 {
     health -= amount;
     if (ui != null)
     {
         ui.UpdateHealthBar(health, maxHealth);
     }
     if (health < 0)
     {
         amount -= health;
         isDead  = true;
         ResourceManager.Instance.SetResourceTile(null, transform.position);
     }
 }