Beispiel #1
0
 public void restoreHealth(int healthToAdd)
 {
     if (IsDead)
     {
         return;
     }
     _currentHealthSO.RestoreHealth(healthToAdd);
     if (_updateHealthEvent != null)
     {
         _updateHealthEvent.RaiseEvent();
     }
 }
Beispiel #2
0
    /// <summary>
    /// Used for cure events, like eating food. Triggered by an IntEventChannelSO.
    /// </summary>
    private void Cure(int healthToAdd)
    {
        if (IsDead)
        {
            return;
        }

        _currentHealthSO.RestoreHealth(healthToAdd);

        if (_updateHealthUI != null)
        {
            _updateHealthUI.RaiseEvent();
        }
    }