public override void DoAction(PEActionParam para = null) { if (null == skillCmpt || null == sword) { return; } PEActionParamVVNN paramVVNN = para as PEActionParamVVNN; trans.position = paramVVNN.vec1; m_AttackDir = paramVVNN.vec2; if (m_AttackDir == Vector3.zero) { m_AttackDir = trans.forward; } m_CombTime = paramVVNN.n1; m_AttackModeIndex = paramVVNN.n2; ApplySkill(); anim.ResetTrigger("ResetFullBody"); anim.SetBool("AttackLand", false); motionMgr.SetMaskState(PEActionMask.SwordAttack, true); m_WaitInput = false; m_TstAttack = false; m_EndAction = false; OnStartAttack(); }
public override bool CanDoAction(PEActionParam para = null) { PEActionParamVVNN paramVVNN = para as PEActionParamVVNN; int attackModeIndex = paramVVNN.n2; if (attackModeIndex >= sword.m_AttackSkill.Length || attackModeIndex >= sword.m_AttackSkill.Length) { return(false); } return(true); }
/// <summary> /// Twos the hand weapon attack. /// </summary> /// <param name="dir">Dir.</param> /// <param name="handType">Hand type 0:TwoHand 1:RightHand 2:LeftHand</param> /// <param name="time">Time.</param> public void TwoHandWeaponAttack(Vector3 dir, int attackModeIndex = 0, int time = 0) { if (null != m_TwoHandWeapon) { PEActionParamVVNN param = PEActionParamVVNN.param; param.vec1 = m_Trans.position; param.vec2 = dir; param.n1 = time; param.n2 = attackModeIndex; m_MotionMgr.DoAction(PEActionType.TwoHandSwordAttack, param); } }
public void SwordAttack(Vector3 dir, int attackModeIndex = 0, int time = 0) { if (null != m_SwordAttack.sword && m_SwordAttack.sword == m_HandChangeHold.handChangeEquipment && m_TwoHandWeapon == null) { PEActionParamVVNN param = PEActionParamVVNN.param; param.vec1 = m_Trans.position; param.vec2 = dir; param.n1 = time; param.n2 = attackModeIndex; m_MotionMgr.DoAction(PEActionType.SwordAttack, param); } }
public override void ResetAction(PEActionParam para = null) { if (!m_EndAction && m_WaitInput && (null != phyMotor && phyMotor.spineInWater) == m_AttackInWater && motionMgr.GetMaskState(PEActionMask.InAir) == m_AttackInAir) { if (attackInAnimTime) { m_CombAttack = true; } else { OnComboAttack(); } } PEActionParamVVNN paramVVNN = para as PEActionParamVVNN; m_PreDir = paramVVNN.vec2; }