Beispiel #1
0
 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);
 }
Beispiel #3
0
 public void CharacterDied()
 {
     OnCharacterDied?.Invoke(this, EventArgs.Empty);
     Debug.Log("charater died");
 }
Beispiel #4
0
 protected void Die()
 {
     OnCharacterDied?.Invoke();
 }