private void IncreaseHealth(float amount) { _currentHealth = Mathf.Min(_currentHealth + amount, _maxHealth); if (_currentHealth < 0f) { OnCharacterDied?.Invoke(this); } }
/// <summary> /// Handles the event when the character is dead /// </summary> public void Handle(OnCharacterDied @event) { _locomotionHandler.Stop(); ToggleStateMachineContexts(false); }
public void CharacterDied() { OnCharacterDied?.Invoke(this, EventArgs.Empty); Debug.Log("charater died"); }
protected void Die() { OnCharacterDied?.Invoke(); }