Ejemplo n.º 1
0
    private void OnRB()
    {
        if (inventoryFlag)
        {
            return;
        }

        if (playerInventory.isFireWeaponEquiped)
        {
            playerInventory.EquipCurrentWeapon();
        }

        if (playerManager.canDoCombo)
        {
            comboFlag = true;
            rodySoundsManager.prepararSonido(3);
            playerAttacker.HandleWeaponCombo(playerInventory.rightWeapon);
            comboFlag = false;
        }
        else
        {
            if (playerManager.isInteracting)
            {
                return;
            }

            if (playerManager.canDoCombo)
            {
                return;
            }
            rodySoundsManager.prepararSonido(3);
            playerAttacker.HandleLightAttack(playerInventory.rightWeapon);
        }
    }
Ejemplo n.º 2
0
    private void HandleAttackInput()
    {
        playerControls.PlayerActions.RB.performed += i => rb_Input = true;
        playerControls.PlayerActions.RT.performed += i => rt_Input = true;

        if (rb_Input)
        {
            if (animatorManager.animator.GetBool("isInteracting"))
            {
                return;
            }
            if (isHoldingWeapon)
            {
                playerAttacker.HandleLightAttack(playerInventory.rightWeapon);
            }
            else
            {
                playerAttacker.HandleLightAttack(playerInventory.Unarmed);
            }
        }
        if (rt_Input)
        {
            if (animatorManager.animator.GetBool("isInteracting"))
            {
                return;
            }
            if (isHoldingWeapon)
            {
                playerAttacker.HandleHeavyAttack(playerInventory.rightWeapon);
            }
            else
            {
                playerAttacker.HandleHeavyAttack(playerInventory.Unarmed);
            }
        }
    }
Ejemplo n.º 3
0
    public void HandleAttackInput()
    {
        //light attack
        playerControls.PlayerActions.RB.performed += i => rb_Input = true;

        //general attack
        playerControls.PlayerActions.RT.performed += i => rt_Input = true;

        if (animatorManager.animator.GetBool("isGrounded"))
        {
            if (!animatorManager.animator.GetBool("isInteracting"))
            {
                if (rb_Input)
                {
                    playerAttacker.HandleLightAttack();
                }
            }

            if (rt_Input && !animatorManager.animator.GetCurrentAnimatorStateInfo(1).IsName("Finding") &&
                !animatorManager.animator.GetCurrentAnimatorStateInfo(1).IsName("Power Up") &&
                !animatorManager.animator.GetCurrentAnimatorStateInfo(1).IsName("Greater Power Up"))
            {
                switch (playerLocomotion.isSprinting)
                {
                case true:
                    if (!animatorManager.animator.GetBool("isInteracting"))
                    {
                        playerAttacker.HandleSprintAttack();
                    }
                    break;

                default:
                    playerAttacker.HandleHeavyAttack();
                    break;
                }
            }
        }
    }