public float BowAttack(Weapon weapon) { lastWeapon = weapon as RangedWeapon; // ChangeAttack Animation playerAnimatorController.OverrideAttack(weapon.animations[0]); animator.SetTrigger("attack"); return(weapon.baseSpeed); }
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]); }