public void ReceiveDamage(float amount) { if (invincible) { return; } health -= amount; onDamaged.Invoke(amount); if (health <= 0) { health = 0; onKilled.Invoke(); } }
public static void SetKilled() { Killed = true; OnKilled.Set(); KilledEvent?.Invoke(); }