コード例 #1
0
    public float BowAttack(Weapon weapon)
    {
        lastWeapon = weapon as RangedWeapon;


        // ChangeAttack Animation

        playerAnimatorController.OverrideAttack(weapon.animations[0]);
        animator.SetTrigger("attack");


        return(weapon.baseSpeed);
    }
コード例 #2
0
    public float Attack(Weapon weapon)
    {
        if (lastWeapon != weapon)
        {
            currentAttackCycle = cycleLenght;
        }
        lastWeapon = weapon;

        Debug.Log(weapon.animations[(currentAttackCycle) % cycleLenght]);
        playerAnimatorController.OverrideAttack(weapon.animations[(currentAttackCycle) % cycleLenght]);
        animator.SetFloat("attackSpeed", 1 / weapon.combatPattern[currentAttackCycle % cycleLenght]);
        animator.SetTrigger("attack");

        //Debug.Log(combatTimer.ToString());
        //playerMotor.SetCanMove(false);

        lastCombatCycle = combatCycleReset;
        return(weapon.combatPattern[(currentAttackCycle) % cycleLenght]);
    }