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