public override float GetWeaponAnimTime(E_WeaponType type, E_WeaponAction action) { string animName; switch (action) { case E_WeaponAction.Switch: animName = WeaponAnimations[type].SwitchIdle; break; case E_WeaponAction.Fire: animName = BlackBoard.MotionType == E_MotionType.None ? WeaponAnimations[type].FireIdle : WeaponAnimations[type].FireRun; break; case E_WeaponAction.Reload: animName = BlackBoard.MotionType == E_MotionType.None ? WeaponAnimations[type].ReloadIdle : WeaponAnimations[type].ReloadRun; break; default: throw new System.NotImplementedException(); } if (animName != null && Animation[animName] != null) { return(Animation[animName].length); } return(0); }
public abstract float GetWeaponAnimTime(E_WeaponType type, E_WeaponAction action);
public abstract string GetWeaponAnim(E_WeaponAction action);
public override string GetWeaponAnim(E_WeaponAction action) { E_WeaponType t = Weapons.GetCurrentWeapon().WeaponType; switch (action) { case E_WeaponAction.Fire: if (BlackBoard.Cover != null) { if (BlackBoard.CoverPose == E_CoverPose.Crouch) { switch (BlackBoard.CoverPosition) { case E_CoverDirection.Left: return(WeaponAnimations[t].FireCoverCrouchLeft); case E_CoverDirection.Right: return(WeaponAnimations[t].FireCoverCrouchRight); default: return(WeaponAnimations[t].FireCoverCrouchCenter); } } else { switch (BlackBoard.CoverPosition) { case E_CoverDirection.Left: return(WeaponAnimations[t].FireCoverStandLeft); case E_CoverDirection.Right: return(WeaponAnimations[t].FireCoverStandRight); } } } if (BlackBoard.MotionType == E_MotionType.None) { return(WeaponAnimations[t].FireIdle); } return(WeaponAnimations[t].FireRun); case E_WeaponAction.Reload: if (BlackBoard.Cover != null) { if (BlackBoard.CoverPose == E_CoverPose.Crouch) { return(WeaponAnimations[t].ReloadCoverCrouch); } else { switch (BlackBoard.CoverPosition) { case E_CoverDirection.Left: return(WeaponAnimations[t].ReloadCoverStandLeft); case E_CoverDirection.Right: return(WeaponAnimations[t].ReloadCoverStandRight); default: return(WeaponAnimations[t].ReloadCoverStand); } } } if (BlackBoard.MotionType == E_MotionType.None) { return(WeaponAnimations[t].ReloadIdle); } else { return(WeaponAnimations[t].ReloadRun); } case E_WeaponAction.Switch: if (BlackBoard.Cover != null) { if (BlackBoard.CoverPose == E_CoverPose.Crouch) { return(WeaponAnimations[t].SwitchCoverCrouch); } return(WeaponAnimations[t].SwitchCoverStand); } return(WeaponAnimations[t].SwitchIdle); } return("Idle"); }