예제 #1
0
    /// <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);
        }
    }
예제 #2
0
    /// <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);
        }
    }
예제 #3
0
    /// <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);
        }
    }
예제 #4
0
    /// <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);
        }
    }
예제 #5
0
    /// <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);
        }
    }
예제 #6
0
    /// <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);
        }
    }
예제 #7
0
    /// <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);
        }
    }