public void IncreaseHealth(float recovery) { CurrentHealth += recovery; // If we later have some sort of healing make sure that it cannot go over its initial full health. CurrentHealth = Mathf.Clamp(CurrentHealth, 0, MaxHealth); //if (this.currentHealth >= this.health) { this.currentHealth = this.health; } UnitGameObject.UpdateHealthText(); }
public void DecreaseHealth(float damage) { CurrentHealth -= damage; UnitGameObject.UpdateHealthText(); }