Ejemplo n.º 1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        /*if (currHealth < maxHealth)
         * {
         *  currHealth += regenAmountHealth;
         *  stats.UpdateHealthUI(currHealth);
         * }*/

        if (parryTimer < 0.0f)
        {
            state      = CombatStates.NONE;
            parryTimer = 0.0f;
        }

        switch (state)
        {
        case CombatStates.BLOCK:
            currStamina -= blockStaminaDecrease;
            break;

        case CombatStates.PARRY:
            currStamina -= parryStaminaDecrease;
            parryTimer  -= Time.deltaTime;
            break;

        default:
            if (currStamina < maxStamina)
            {
                currStamina += regenAmountStamina;
            }
            break;
        }

        stats.UpdateStaminaUI(currStamina);

        if (currStamina < staminaActionMinimal && state != CombatStates.NONE)
        {
            SetState(CombatStates.NONE);
        }
    }