public void TakeDamage(int damage) { tintColor.SetTintColor(new Color(255, 0, 0, 255)); currentHealth -= damage; if (currentHealth <= 0) { Die(); } }
public void TakeDamage(int damage) { tintColor.SetTintColor(new Color(255, 0, 0, 255)); currentHealth -= damage; if (healthBar != null) { healthBar.SetHealth(currentHealth); } if (currentHealth <= 0 && !isDead) { Die(); Debug.Log("the player has been slayed"); } }