public void HealStamina(int healAmount) { CurrentStamina = Mathf.Min(CurrentStamina + healAmount, MaxStamina); OnStaminaHealedEvent.Invoke(healAmount); OnCurrentStaminaUpdated.Invoke(StaminaFillRate); if (CurrentStamina == MaxStamina) { OnStaminaFullyRegeneratedEvent.Invoke(); } }
public void Regenerate(int regeneratiOnRate) { var lastStamina = CurrentStamina; CurrentStamina = Mathf.Min(CurrentStamina + regeneratiOnRate, MaxStamina); OnStaminaRegeneratingEvent.Invoke(CurrentStamina - lastStamina); OnCurrentStaminaUpdated.Invoke(StaminaFillRate); if (CurrentStamina == MaxStamina) { OnStaminaFullyRegeneratedEvent.Invoke(); } }