public void Damage(int damageCount) { hp -= damageCount; if (hp <= 0) { BaseScript script = GetComponent <BaseScript>(); script.GameOver(); } UpdateHealth(); }