/// <summary> /// BT_LeapBreak,打断跃迁,恢复姿态 /// </summary> /// <param name="motion"></param> public void LeapBreak(PhysxMotionType motion = PhysxMotionType.Jet) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_LeapBreak)) { ((LeapBreakBehavior)GetBehaviorEntity(BehaviorType.BT_LeapBreak)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_force, m_invforce, m_stopforce, m_torque, m_stoptourque, m_maxsp, m_invmaxsp, m_maxanglespeed, true); } }
/// <summary> /// WorldForceControlMove /// </summary> /// <param name="worldforce"></param> /// <param name="orientations"></param> /// <param name="motion"></param> public void WorldForceControlMove(Vector3 worldforce, Vector3 orientations, PhysxMotionType motion = PhysxMotionType.Spacecraft) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_WorldForceCtlMove)) { ((WorldForceControlMoveBehavior)GetBehaviorEntity(BehaviorType.BT_WorldForceCtlMove)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_force, m_invforce, m_stopforce, m_torque, m_stoptourque, m_maxsp, m_invmaxsp, m_maxanglespeed, worldforce, orientations, true); } }
/// <summary> /// BT_Leap,跃迁 /// </summary> /// <param name="targets"></param> /// <param name="motion"></param> public void Leap(List <Vector3> targets, float waittime = 3.0f, PhysxMotionType motion = PhysxMotionType.Jet) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_Leap)) { ((LeapBehavior)GetBehaviorEntity(BehaviorType.BT_Leap)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_force, m_invforce, m_stopforce, m_torque, m_stoptourque, m_maxsp, m_invmaxsp, m_maxanglespeed, m_leapforce, m_leapstopforce, targets, waittime, true); } }
/// <summary> /// BT_SmoothMoveTargets,按照路点移动,直到到达最后一个目标 /// </summary> /// <param name="targets"></param> /// <param name="motion"></param> public void SmoothMoveTargets(List <Vector3> targets, PhysxMotionType motion = PhysxMotionType.Jet) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_SmoothMoveTargets)) { ((SmoothMoveTargetsBehavior)GetBehaviorEntity(BehaviorType.BT_SmoothMoveTargets)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_force, m_invforce, m_stopforce, m_torque, m_stoptourque, m_maxsp, m_invmaxsp, m_maxanglespeed, targets, true); } }
/// <summary> /// BT_StopThenMoveToTarget, 停止,再直接移动到目标点行为 /// </summary> /// <param name="target"></param> /// <param name="motion"></param> public void StopThenMoveToTarget(Vector3 target, PhysxMotionType motion = PhysxMotionType.Jet) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_StopThenMoveToTarget)) { ((StopThenMoveToTargetBehavior)GetBehaviorEntity(BehaviorType.BT_StopThenMoveToTarget)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_force, m_invforce, m_stopforce, m_stoptourque, m_maxsp, m_invmaxsp, target, true); } }
/// <summary> /// BT_StopMove,停止移动 /// </summary> /// <param name="motion"></param> public void StopMove(PhysxMotionType motion = PhysxMotionType.Jet) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_StopMove)) { ((StopMoveBehavior)GetBehaviorEntity(BehaviorType.BT_StopMove)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_stopforce, true); } }
/// <summary> /// 转向目标,如果当前有角度都,先停止角速度,再旋转 /// </summary> /// <param name="target"></param> /// <param name="motion"></param> public void TurnToTarget(Vector3 target, PhysxMotionType motion = PhysxMotionType.Jet) { if (!IsBehaviorControllerEnable()) { return; } if (AddBehavior(BehaviorType.BT_TurnToTarget)) { ((TurnToTargetBehavior)GetBehaviorEntity(BehaviorType.BT_TurnToTarget)).Init( this, Time.fixedTime, -1, m_rigidbody, motion, m_torque, m_stoptourque, m_maxanglespeed, target, true); } }