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