public void SetSwingMod(AttackModType _atkType) { attackScript.attackSpeed = AnimMods[(int)_atkType].swing; }
public void SetRecoverMod(AttackModType _atkType) { if (InputScript == null) // no combos attackScript.attackSpeed = AnimMods[(int)_atkType].recover; else { if (NextAttack != State.IDLE) { switch (NextAttack) { case State.ATK_VERT: { //ChangeState(State.IDLE); //SlashVert(); attackScript.attackSpeed = AnimMods[(int)_atkType].recover; break; } case State.ATK_LTR: { ChangeState(State.IDLE); SlashVert(); break; } case State.ATK_RTL: { ChangeState(State.IDLE); SlashLTR(); break; } case State.ATK_STAB: { ChangeState(State.IDLE); Thrust(); break; } case State.ATK_KICK: { ChangeState(State.IDLE); Kick(); break; } } } } }
// SetWindupMod(), SetSwingMod(), SetRecoverMod() functions // Animations call these functions at the correct time in order to adjust animation speed. public void SetWindupMod(AttackModType _atkType) { if (InputScript == null) // no combos attackScript.attackSpeed = AnimMods[(int)_atkType].windup; else { if (NextAttack != State.IDLE) { switch (NextAttack) { case State.ATK_VERT: { //attackScript.attackSpeed = 2.0f; animation["Down Slash"].time = 0.22f; NextAttack = State.IDLE; break; } case State.ATK_LTR: { //attackScript.attackSpeed = 2.0f; animation["Right Slash"].time = 0.21f; NextAttack = State.IDLE; break; } case State.ATK_RTL: { //attackScript.attackSpeed = 1000.0f; //NextAttack = State.IDLE; break; } } } } }