示例#1
0
    void Update()
    {
        if (Input.GetButtonDown("Dash"))
        {
            if (pStats.stamina > dashStaminaUse)
            {
                pStats.ModStamina(-dashStaminaUse);
                pFunc.InitDash();
            }
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (pAttack.canAttack() && (pStats.stamina > attackStaminaUse))
            {
                pAttack.initAttack();
                pStats.ModStamina(-attackStaminaUse);
                pVisuals.attackUpdate(pAttack.attackBox, pAttack);
            }
        }
        if (Input.GetMouseButtonDown(1))
        {
            if (pAttack.canAttack() && !pPSystem.parrying && pPSystem.CanParry())
            {
                if (pStats.stamina > parryStaminaUse)
                {
                    pPSystem.DoParry();
                    pStats.ModStamina(-parryStaminaUse);
                }
            }
        }
    }
示例#2
0
 void Update()
 {
     if (Input.GetButtonDown("Dash"))
     {
         if (pStats.stamina > dashStaminaUse)
         {
             pStats.ModStamina(-dashStaminaUse);
             pFunc.InitDash();
         }
     }
 }