public void Heal(float value) { if (value + CurrentHealth >= maxHealth) { CurrentHealth = maxHealth; healthControl.addValue(maxHealth - CurrentHealth); } else { CurrentHealth += value; healthControl.addValue(value); } }
public void RecoverStamina() { var value = staminaRecoverRate * Time.deltaTime; if (currentStamina <= maxStamina) { staminaController.addValue(value); currentStamina += value; } }