public static void TakeHealing(this ICharacterClass characterClass, float healingTaken) { if (characterClass.CheckIfDead() == false) { float maximumHealth = characterClass.GetMaximumHealth(); float currentHealth = characterClass.GetCurrentHealth(); bool healingOverflow = currentHealth + healingTaken > maximumHealth; float validatedHealthValue = healingOverflow ? maximumHealth : currentHealth + healingTaken; characterClass.SetCurrentHealth(validatedHealthValue); characterClass.GetStatusBarManager().PerformValueChangeTextEffectWithColor(healingTaken, StateValueChangeAction.TakingHealing); } }
public void HealthButton_OnClick() { selectedCharacterClass.TakeHealing(selectedCharacterClass.GetMaximumHealth()); }
private void RefreshPlayerStatusBar() { staminaBarFillImage.fillAmount = characterClass.GetCurrentStamina() / characterClass.GetMaximumStamina(); manaBarFillImage.fillAmount = characterClass.GetCurrentMana() / characterClass.GetMaximumMana(); healthBarFillImage.fillAmount = characterClass.GetCurrentHealth() / characterClass.GetMaximumHealth(); }