Пример #1
0
        public void HealStamina(int healAmount)
        {
            CurrentStamina = Mathf.Min(CurrentStamina + healAmount, MaxStamina);
            OnStaminaHealedEvent.Invoke(healAmount);
            OnCurrentStaminaUpdated.Invoke(StaminaFillRate);

            if (CurrentStamina == MaxStamina)
            {
                OnStaminaFullyRegeneratedEvent.Invoke();
            }
        }
Пример #2
0
        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();
            }
        }