public void ApplyDamage(Damage damage) { if (godmode) { return; } if (health <= damage.amount) { health = 0; } else { health -= damage.amount; } if (inGameUi != null) { inGameUi.UpdateHealthBar(health, maxHealth); } }