public void DealDamage(int damageDealt) { int clampedHealth = Mathf.Clamp(_player.Health - damageDealt, 0, _player.HealthMax); _player.Health = clampedHealth; PlayerDealtDamageEvent?.Invoke(damageDealt); if (_player.Health <= 0) { PlayerDeadEvent?.Invoke(); } }
private void OnPlayerDead() { PlayerDeadEvent?.Invoke(); }