예제 #1
0
 public void Heal(float value)
 {
     if (value + CurrentHealth >= maxHealth)
     {
         CurrentHealth = maxHealth;
         healthControl.addValue(maxHealth - CurrentHealth);
     }
     else
     {
         CurrentHealth += value;
         healthControl.addValue(value);
     }
 }
예제 #2
0
    public void RecoverStamina()
    {
        var value = staminaRecoverRate * Time.deltaTime;

        if (currentStamina <= maxStamina)
        {
            staminaController.addValue(value);
            currentStamina += value;
        }
    }