Ejemplo n.º 1
0
 private void SetLockMonster(Monster monster)
 {
     m_LockCampsiteMonster = monster;
     if (monster != null)
     {
         m_Gun.enabled = true;
         Vector3 dir = monster.transform.position - transform.position;
         dir.z = 0;
         float   angleZ     = EZMath.SignedAngleBetween(dir, Vector3.up);
         Vector3 eulerAngle = transform.eulerAngles;
         float   dtAngle    = angleZ - eulerAngle.z;
         if (dtAngle > 180f)
         {
             dtAngle -= 360f;
         }
         if (dtAngle < -180)
         {
             dtAngle += 360f;
         }
         angleZ = eulerAngle.z + dtAngle * BaseScene.GetDtTime() * 15;
         transform.eulerAngles = new Vector3(0, 0, angleZ);
         PlayFight();
     }
     else
     {
         PlayIdle();
     }
 }
Ejemplo n.º 2
0
        void Update()
        {
            if (m_StartAct)
            {
                SwingHand();
            }
            else
            {
                m_CurTime += GetActDtTime();
                if (m_CurTime >= DtTime)
                {
                    if (m_Monster.TriggerSecondAct())
                    {
                        m_Monster.SetAnimFloat(GameConstVal.SpeedSymbolStr, 1.0f);
                        m_CurTime = 0;
                        m_Monster.SetSpeed(Vector2.zero);
                        m_Monster.PlayAnim(GameConstVal.Skill02);
                        m_StartAct       = true;
                        m_InstanceBullet = true;
                        m_Effect.gameObject.SetActive(true);
                        m_Monster.SetAnimFloat(GameConstVal.SpeedSymbolStr, 0.0f);

                        Vector3 vec = m_Player.transform.position - transform.position;
                        transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(vec, Vector3.up));
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void AddArrowEffect(bool visible, PylonEle fromPylonEle)
        {
            if (m_ArrowEffect == null)
            {
                m_ArrowEffect = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Eletower_02_zhiyin).GetComponent <RepreatEffect>();
            }
            if (visible)
            {
                int index = fromPylonEle.GetIndex();
                if (index == m_PylonEles.Length - 1)
                {
                    m_Symbol = -1;
                }
                else if (index == 0)
                {
                    m_Symbol = 1;
                }
                int      nextIndex  = index + m_Symbol;
                PylonEle toPylonEle = m_PylonEles[nextIndex];

                Vector3 dtVec3 = toPylonEle.transform.position - fromPylonEle.transform.position;
                float   angleZ = EZMath.SignedAngleBetween(dtVec3, Vector3.up);
                m_ArrowEffect.transform.localEulerAngles = new Vector3(0, 0, angleZ + 90);
                m_ArrowEffect.transform.position         = fromPylonEle.transform.position + dtVec3 / 2;
                float length = dtVec3.magnitude;
                m_ArrowEffect.transform.localScale = new Vector3(length, 1, 1);
                m_ArrowEffect.SetLength(length);
            }
            m_ArrowEffect.gameObject.SetActive(visible);
        }
Ejemplo n.º 4
0
 public void ForceFaceToEnemy()
 {
     if (m_LockGameEnemy)
     {
         float angleZ = EZMath.SignedAngleBetween(m_LockGameEnemy.transform.position - m_RotateRoleNode.position, Vector3.up);
         CalcAngles(angleZ, true);
     }
 }
Ejemplo n.º 5
0
        public override void Init(GameObject player, Wave wave, Monster monster)
        {
            base.Init(player, wave, monster);
            m_InAnimAct = false;
            Vector3 speedVec = m_Player.transform.position - transform.position;

            speedVec = speedVec.normalized;
            transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(speedVec, Vector3.up));
        }
Ejemplo n.º 6
0
        void Update()
        {
            float dtTime = BaseScene.GetDtTime();

            m_CurTime = m_CurTime + dtTime;

            if (m_StartAct)
            {
                if (dtTime == 0)
                {
                    m_Monster.SetSpeed(Vector2.zero);
                    return;
                }
                JumpToMainPlayer();
            }
            else if (!m_InAnimAct)
            {
                if (!m_StartAct)
                {
                    m_CurTime = m_CurTime + BaseScene.GetDtTime();
                    if (m_CurTime >= DtTime && m_Monster.TriggerSecondAct())
                    {
                        m_CurTime = 0;
                        m_Monster.SetSpeed(Vector2.zero);
                        m_Monster.PlayAnim(GameConstVal.Skill01, -1, 0);
                        m_StartAct  = true;
                        m_InAnimAct = true;
                        Vector3 speedVec = m_Player.transform.position - transform.position;
                        transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(speedVec, Vector3.up));
                        m_LockSpeed   = speedVec.normalized * 3;
                        m_LockPos     = m_Player.transform.position;
                        m_CurPosition = transform.position;
                        GetComponent <Collider2D>().enabled    = false;
                        GetComponent <Rigidbody2D>().simulated = false;
                        m_InstanceBullet = false;
                        InitLockEffect();
                    }
                }
            }
            else
            {
                m_CurTime = m_CurTime + BaseScene.GetDtTime();
                if (m_CurTime >= m_AnimTime)
                {
                    InstanceBullet();
                    GetComponent <Collider2D>().enabled    = true;
                    GetComponent <Rigidbody2D>().simulated = true;
                    m_Monster.PlayAnim(GameConstVal.Run);
                    m_Monster.EndSecondAct();
                    m_CurTime   = 0;
                    m_InAnimAct = false;
                    m_StartAct  = false;
                }
            }
        }
Ejemplo n.º 7
0
        void CalcPos()
        {
            float magnitude = (m_StartMonster.transform.position - m_EndMonster.transform.position).magnitude;

            transform.localScale = new Vector3(1, 1, magnitude / 2.3f);
            Vector3 newPos = m_StartMonster.GetBodyNode().position;

            transform.position = newPos;
            float angleZ = EZMath.SignedAngleBetween(m_EndMonster.transform.position - m_StartMonster.transform.position, Vector3.up);

            transform.localEulerAngles = new Vector3(0, 0, angleZ + 90);
        }
Ejemplo n.º 8
0
        private void HurlToMainPlayer()
        {
            Vector3 speedVec = m_Player.transform.position - transform.position;

            transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(speedVec, Vector3.up));
            if (m_CurTime >= m_DelayTime)
            {
                m_StartAct = false;
                GameObject rugbyBall = Instantiate(RugbyBall);
                rugbyBall.GetComponent <RugbyBullet>().Init(1, FirePoint, m_Player.transform.position - FirePoint.position);
            }
        }
Ejemplo n.º 9
0
 private void FaceToEnemyImp()
 {
     if (m_RelativeSpace == FaceMode.FaceToMonster)
     {
         float angleZ = EZMath.SignedAngleBetween(m_DstUpVec, Vector3.up);
         CalcAnglesWorld(angleZ);
     }
     else
     {
         CalcAnglesLocal(0);
     }
 }
Ejemplo n.º 10
0
        void Update()
        {
            float dtTime = BaseScene.GetDtTime();

            if (m_StartAct)
            {
                m_Monster.SetSpeed(Vector2.zero);
                if (dtTime == 0)
                {
                    return;
                }
                m_CurTime = m_CurTime + dtTime;
                FireToMainPlayer();

                Vector3 speedVec = m_Player.transform.position - transform.position;
                transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(speedVec, Vector3.up));
            }
            else if (!m_InAnimAct)
            {
                m_CurTime += GetActDtTime();
                if (m_CurTime >= DtTime)
                {
                    if (m_Monster.TriggerFirstAct())
                    {
                        m_CurTime = 0;
                        m_Monster.SetSpeed(Vector2.zero);
                        m_Monster.PlayAnim(GameConstVal.Skill01);
                        m_StartAct  = true;
                        m_InAnimAct = true;
                        m_ResetAnim = true;
                    }
                }
            }
            else if (m_InAnimAct)
            {
                m_CurTime = m_CurTime + dtTime;
                m_Monster.SetSpeed(Vector2.zero);
                if (m_ResetAnim && m_CurTime > m_ResetAnimTime)
                {
                    m_ResetAnim = false;
                    m_Monster.PlayAnim(GameConstVal.Run);
                }
                if (m_CurTime >= m_AnimTime)
                {
                    m_Monster.PlayAnim(GameConstVal.Run);
                    m_Monster.EndFirstAct();
                    m_CurTime   = 0;
                    m_InAnimAct = false;
                    m_ResetAnim = false;
                }
            }
        }
Ejemplo n.º 11
0
        public void ArriveAtDst(Vector3 position)
        {
            m_CurTime          = 0;
            transform.position = position;
            GameObject effect = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Skill01_2011);

            effect.transform.position = position;
            Vector3 speedVec = m_Player.transform.position - transform.position;

            transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(speedVec, Vector3.up));
            m_Monster.PlayAnim(GameConstVal.Skill02, -1, 0f);
            m_Monster.SetAnimFloat(GameConstVal.SpeedSymbolStr, 1.0f);
            m_AnimTime = m_DelayTime;
        }
Ejemplo n.º 12
0
 private void FaceToEnemyImp()
 {
     if (m_LockGameEnemy)
     {
         float angleZ = EZMath.SignedAngleBetween(m_LockGameEnemy.transform.position - m_RotateRoleNode.position, Vector3.up);
         CalcAngles(angleZ);
         m_WeaponMgr.SetCurMainWeaponEnabled(true);
     }
     else
     {
         m_WeaponMgr.SetCurMainWeaponEnabled(false);
         //CalcAngles(0);
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// 寻路生效
        /// </summary>
        public void EnablePath()
        {
            if (m_AiPath.enabled)
            {
                return;
            }
            Transform targetNode = GetTargetNode();

            transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(targetNode.position - transform.position, Vector3.up));
            m_AiPath.enabled           = true;
            m_rvoController.enabled    = true;
            m_seeker.StartPath(transform.position, targetNode.position);
            PathInit.curPathNum++;
        }
Ejemplo n.º 14
0
        private void AddWallImp(PylonEle fromPylonEle, PylonEle toPylonEle)
        {
            //m_CurWall
            if (m_CurWall == null)
            {
                m_CurWall = Global.gApp.gResMgr.InstantiateObj(EffectConfig.PylonWallEffect).transform;
            }
            Vector3 dtVec3 = toPylonEle.transform.position - fromPylonEle.transform.position;
            float   angleZ = EZMath.SignedAngleBetween(dtVec3, Vector3.up);

            m_CurWall.localEulerAngles = new Vector3(0, 0, angleZ + 90);
            m_CurWall.position         = fromPylonEle.transform.position + dtVec3 / 2;
            m_CurWall.localScale       = new Vector3(dtVec3.magnitude / 6.45f, 1, 1);
            m_CurWall.gameObject.SetActive(true);
        }
Ejemplo n.º 15
0
        public override void Update()
        {
            float dtTime = BaseScene.GetDtTime();

            if (!m_InDeath && dtTime > 0)
            {
                Vector3 dtPos = m_PlayerPos - transform.position;
                transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(dtPos, Vector3.up));
                m_Rigidbody2D.velocity     = dtPos.normalized * m_Speed;
            }
            else
            {
                m_Rigidbody2D.velocity = Vector2.zero;
            }
        }
Ejemplo n.º 16
0
 private void RandomAct()
 {
     if (!m_StartAct)
     {
         m_StartAct = true;
         m_Monster.PlayAnim(GameConstVal.Run);
         float randomAngle = Mathf.Deg2Rad * Random.Range(0, 360);
         m_SpeedVec = new Vector2(Mathf.Cos(randomAngle), Mathf.Sin(randomAngle)) * Speed;
         m_ActTime  = Random.Range(m_StrollTime - 0.5f, m_StrollTime + 0.5f);
         transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(m_SpeedVec, Vector3.up));
     }
     else
     {
         m_StartAct = false;
         m_Monster.PlayAnim(GameConstVal.Idle);
         m_SpeedVec = Vector2.zero;
         m_ActTime  = Random.Range(m_IdleTime - 0.2f, m_IdleTime + 0.1f);
     }
 }
Ejemplo n.º 17
0
        public void CalcCurAnim(float sx, float sy)
        {
            if (BaseScene.GetDtTime() <= 0)
            {
                return;
            }
            if (sx != 0 || sy != 0)
            {
                Vector3 speedV = new Vector3(sx, sy, 0);
                float   angle  = EZMath.SignedAngleBetween(speedV, Vector3.up);

                m_Player.angle = angle;

                // Debug.Log(angle);

                Vector3 roleEulerAngle = m_RotateRoleNode.eulerAngles;
                float   roleAngleZ     = roleEulerAngle.z;
                float   relativeAngleZ = angle - roleAngleZ;
                relativeAngleZ = relativeAngleZ >= 0 ? relativeAngleZ : relativeAngleZ + 360;
                if (relativeAngleZ <= 45 || relativeAngleZ >= 315)
                {
                    PlayDAnim(GameConstVal.Run);
                }
                else if (relativeAngleZ >= 45 && relativeAngleZ <= 135)
                {
                    PlayDAnim(GameConstVal.Run_left);
                }
                else if (relativeAngleZ >= 135 && relativeAngleZ <= 215)
                {
                    PlayDAnim(GameConstVal.Run_back);
                }
                else
                {
                    PlayDAnim(GameConstVal.Run_right);
                }
            }
            else
            {
                m_Player.angle = -1f;
                PlayDAnim(GameConstVal.Idle);
            }
        }
Ejemplo n.º 18
0
 public void Move(float sx, float sy)
 {
     // 有载具 就先 走载具
     if (!m_Carrier.HasCarrier())
     {
         if (m_InNormalPassType)
         {
             Vector2 velocity = new Vector2(sx, sy);
             m_Player.SetSpeed(velocity.normalized * m_Player.GetSpeed() * BaseScene.TimeScale);
             CalcCurAnim(sx, sy);
             MoveImp(sx, sy);
         }
         else
         {
             sy = 0;
             Vector2 velocity = new Vector2(sx, sy);
             m_Player.SetSpeed(velocity.normalized * m_Player.GetSpeed() * BaseScene.TimeScale);
             CalcCurAnim(0, 1);
             MoveImp(0, 1);
         }
     }
     else
     {
         if (m_InNormalPassType)
         {
             m_Carrier.Move(sx, sy);
             MoveImp(sx, sy);
         }
         else
         {
             sy = Mathf.Abs(sx) * 3;
             m_Carrier.Move(sx, 0);
             if (sx == 0 && sy == 0)
             {
                 sy = 1;
             }
             float angleZ = EZMath.SignedAngleBetween(new Vector3(sx, sy, 0), Vector3.up);
             CalcAngles(angleZ);
         }
     }
 }
Ejemplo n.º 19
0
        private void FaceToEnemyImp()
        {
            if (m_LockGameEnemy)
            {
                float angleZ = EZMath.SignedAngleBetween(m_LockGameEnemy.transform.position - m_RotateRoleNode.position, Vector3.up);

                CalcAngles(angleZ);
                if (!m_Gun.enabled)
                {
                    m_Gun.enabled = true;
                }
            }
            else
            {
                if (m_Gun.enabled)
                {
                    m_Gun.enabled = false;
                }
                PlayTurretAnim(GameConstVal.Idle_Deploy);
            }
        }
Ejemplo n.º 20
0
        public void Update()
        {
            float   angleZ1      = m_LockTransform.localEulerAngles.z * Mathf.Deg2Rad;
            float   cosVal       = (float)Math.Cos(angleZ1);
            float   sinVal       = (float)Math.Sin(angleZ1);
            Vector3 newOffset    = new Vector3(cosVal * m_Offset.x - sinVal * m_Offset.y, sinVal * m_Offset.x + cosVal * m_Offset.y, 0);
            Vector3 vector       = (m_LockTransform.position + newOffset - m_OwnnerTsf.position);
            float   sqrMagnitude = vector.sqrMagnitude;

            if (sqrMagnitude > m_SqrBreakDis)
            {
                if (m_BreakCallBack != null)
                {
                    m_BreakCallBack();
                    return;
                }
            }
            if (m_RotateState)
            {
                float angleZ = EZMath.SignedAngleBetween(vector, Vector3.up);
                m_OwnnerTsf.localEulerAngles = new Vector3(0, 0, angleZ);
            }
            if (m_FollowState)
            {
                if (sqrMagnitude > m_SqrMaxRadio)
                {
                    m_Pet.SetSpeed(vector.normalized * m_FollowSpeed);
                }
                else if (sqrMagnitude < m_SqrMinRadio)
                {
                    m_Pet.SetSpeed(-vector.normalized * m_FollowSpeed);
                }
                else
                {
                    m_Pet.SetSpeed(Vector3.zero);
                }
            }
        }
Ejemplo n.º 21
0
        void Update()
        {
            float dtTime = BaseScene.GetDtTime();

            m_CurTime = m_CurTime + dtTime;
            if (dtTime == 0)
            {
                m_Monster.SetAbsSpeed(Vector2.zero);
                return;
            }
            if (m_StartAct)
            {
                DashToMainPlayer();
            }
            else
            {
                if (m_CurTime >= DtTime)
                {
                    if (m_Monster.TriggerSecondAct())
                    {
                        m_CurTime = 0;
                        m_Monster.SetAbsSpeed(Vector2.zero);
                        m_Monster.PlayAnim(GameConstVal.Skill01);
                        m_StartAct         = true;
                        m_NeedCalcSpeed    = true;
                        m_RightBody2d.mass = 999999999;
                        if (m_NeedCalcSpeed)
                        {
                            m_NeedCalcSpeed            = false;
                            m_SpeedVec                 = m_Player.transform.position - transform.position;
                            m_SpeedVec                 = m_SpeedVec.normalized;
                            transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(m_SpeedVec, Vector3.up));
                            InstanceEffect();
                        }
                    }
                }
            }
        }
Ejemplo n.º 22
0
        public void MoveImp(float sx, float sy)
        {
            // Move the character

            if (m_LockGameEnemy == null)
            {
                if (sx != 0 || sy != 0)
                {
                    float angleZ = EZMath.SignedAngleBetween(new Vector3(sx, sy, 0), Vector3.up);
                    CalcAngles(angleZ);
                }
                if (!m_Carrier.HasCarrier())
                {
                    PlayUAnim(GameConstVal.Idle);
                }
            }
            else
            {
                if (!m_Carrier.HasCarrier())
                {
                }
            }
        }
Ejemplo n.º 23
0
 private void CheckEnd()
 {
     if (m_CurTime < m_FaceTime)
     {
         Vector3 faceVec = m_Player.transform.position - transform.position;
         transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(faceVec, Vector3.up));
     }
     if (m_CurTime > m_PauseStartTime && m_CurTime < m_PauseEndTime)
     {
         m_Monster.SetAnimFloat(GameConstVal.SpeedSymbolStr, 0.0f);
     }
     else
     {
         m_Monster.SetAnimFloat(GameConstVal.SpeedSymbolStr, 1.0f);
     }
     if (m_CurTime > m_SkillTime)
     {
         m_Monster.PlayAnim(GameConstVal.Run);
         m_CurTime  = 0;
         m_StartAct = false;
         m_Monster.EndFirstAct();
     }
 }
Ejemplo n.º 24
0
 protected void UpdatePointArrow(bool visible)
 {
     if (!m_InNormalPass)
     {
         return;
     }
     if (m_TaskState == TaskState.Begin)
     {
         if (visible)
         {
             if (m_TargetTsf != null && m_PlayerTsf != null)
             {
                 Vector3 pointVec = m_TargetTsf.position - m_PlayerTsf.position;
                 pointVec.z = 0;
                 float newLength = pointVec.magnitude;
                 if (newLength < 500)
                 {
                     float angle = EZMath.SignedAngleBetween(pointVec, Vector3.up);
                     Global.gApp.gMsgDispatcher.Broadcast <float, string, FightTaskUiType>(MsgIds.PointArrowAngle, angle, ((int)pointVec.magnitude).ToString() + "m", m_FightArrowType);
                 }
                 else
                 {
                     Global.gApp.gMsgDispatcher.Broadcast <float, string, FightTaskUiType>(MsgIds.PointArrowAngle, -100, GameConstVal.EmepyStr, m_FightArrowType);
                 }
             }
             else
             {
                 Global.gApp.gMsgDispatcher.Broadcast <float, string, FightTaskUiType>(MsgIds.PointArrowAngle, -100, GameConstVal.EmepyStr, m_FightArrowType);
             }
         }
         else
         {
             Global.gApp.gMsgDispatcher.Broadcast <float, string, FightTaskUiType>(MsgIds.PointArrowAngle, -100, GameConstVal.EmepyStr, m_FightArrowType);
         }
     }
 }
Ejemplo n.º 25
0
 void Update()
 {
     if (m_StartAct)
     {
         BitePlayer();
     }
     else
     {
         m_CurTime += GetActDtTime();
         if (m_CurTime >= DtTime)
         {
             Vector3 speedVec = m_Player.transform.position - transform.position;
             if (speedVec.sqrMagnitude < m_SqrTriggerRange && m_Monster.TriggerFirstAct())
             {
                 m_CurTime = 0;
                 m_Monster.SetSpeed(Vector2.zero);
                 m_Monster.PlayAnim(GameConstVal.Skill01);
                 m_StartAct = true;
                 transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(speedVec, Vector3.up));
                 m_LockSpeed = speedVec.normalized;
             }
         }
     }
 }
Ejemplo n.º 26
0
        private void Update()
        {
            Vector3 faceVec = m_PlayerGo.transform.position - transform.position;

            transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(faceVec, Vector3.up));
        }
Ejemplo n.º 27
0
        private void MoveToRole()
        {
            Transform targetNode = GetTargetNode();

            if (targetNode != null)
            {
                Vector3 posStart  = transform.position;
                Vector3 targetPos = targetNode.position;
                Vector2 velocity  = new Vector2(targetPos.x - posStart.x, targetPos.y - posStart.y);
                // 僵尸是否愚蠢
                if (!m_AutomaticPath || (m_AutomaticPath && !m_AiPath.enabled))
                {
                    if (velocity.sqrMagnitude > 0.25f)
                    {
                        Vector2 velocity2 = velocity.normalized * m_BaseSpeed * m_HitSpeedScale;
                        m_Monster.SetSpeed(velocity2 * BaseScene.TimeScale);
                        transform.localEulerAngles = new Vector3(0, 0, EZMath.SignedAngleBetween(targetPos - posStart, Vector3.up));
                    }
                    else
                    {
                        m_Monster.SetSpeed(Vector2.zero);
                    }
                }
                else
                {
                    // 是否在外面,并根据是否在屏幕外做优化
                    if (m_Monster.InShadowView)
                    {
                        m_collider.isTrigger = false;
                        if (!isNoUsePath)
                        {
                            m_AiPath.repathRate = 0.2f;
                        }
                        m_rvoController.agentTimeHorizon    = 0.4f; // 检测代理碰撞的时间间隔
                        m_rvoController.obstacleTimeHorizon = 0.6f; // 检测其他障碍碰撞的时间间隔
                        m_rvoController.maxNeighbours       = 2;
                    }
                    else
                    {
                        m_collider.isTrigger = true;

                        if (!isNoUsePath)
                        {
                            m_AiPath.repathRate = 0.5f;
                        }
                        m_rvoController.agentTimeHorizon    = 1f; // 检测代理碰撞的时间间隔
                        m_rvoController.obstacleTimeHorizon = 1f; // 检测其他障碍碰撞的时间间隔
                        m_rvoController.maxNeighbours       = 2;
                    }


                    // 插件的目标
                    if (m_seeker.IsDone())
                    {
                        m_AiPath.destination = targetNode.position;
                    }

                    if (velocity.sqrMagnitude > 0.25f)
                    {
                        //Vector2 velocity2 = velocity.normalized * m_BaseSpeed * m_HitSpeedScale;
                        float velocity2Val = m_BaseSpeed * m_HitSpeedScale;
                        // 修改为插件速度
                        float speedVal = velocity2Val * BaseScene.TimeScale;
                        float newSpeed = 1;
                        if (m_Monster.m_AiBuffMgr != null)
                        {
                            newSpeed += m_Monster.m_AiBuffMgr.GetIncMoveSpeed();
                        }
                        speedVal *= newSpeed;

                        m_AiPath.maxSpeed = speedVal;
                    }
                    else
                    {
                        //修改为插件速度
                        m_AiPath.maxSpeed = 0;
                    }
                }
            }
        }