少年修仙传客户端代码仓库
client_Hale
2018-10-19 3e2b966a7b1b0b64c2c7beaff6b24a7a89d79611
382 增加自动战斗AI移动中对终点距离判断误差
1个文件已修改
27 ■■■■■ 已修改文件
Fight/GameActor/GActor.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActor.cs
@@ -103,10 +103,10 @@
        set
        {
            m_State = value;
            //if (ServerInstID == PlayerDatas.Instance.PlayerId)
            //{
            //    Debug.Log("状态改变: " + State.ToString());
            //}
            // if (ServerInstID == PlayerDatas.Instance.PlayerId)
            // {
            //     Debug.Log("状态改变: " + value.ToString());
            // }
        }
    }
@@ -306,7 +306,7 @@
    {
        if (PathFindStatus == E_PathFindStatus.Moving
         && m_SearchType == E_SearchType.Static
         && DestPos == destPos)
         && MathUtility.DistanceSqrtXZ(DestPos, destPos) < 0.01f)
        {
            Run();
            return;
@@ -371,6 +371,11 @@
        {
            OnPathFindStop();
        }
        // if (ServerInstID == PlayerDatas.Instance.PlayerId)
        // {
        //     Debug.Log("停止了移动");
        // }
    }
    private void MoveTo(Vector3 position, float keepDist = 0)
@@ -380,10 +385,10 @@
        if (NavMesh.CalculatePath(_curPos, position, NavMesh.AllAreas, m_Path))
        {
            //if (this is GA_Hero)
            //{
            //    Debug.LogFormat("调用了 {0} 的寻路, 目标点: {1}", ServerInstID, position);
            //}
            // if (this is GA_Hero)
            // {
            //     Debug.LogFormat("调用了 {0} 的寻路, 目标点: {1}", ServerInstID, position);
            // }
            m_CornerIndex = 0;
            m_KeepDist = keepDist;
            PathFindStatus = E_PathFindStatus.Moving;
@@ -467,8 +472,8 @@
                {
                    _deltaDis = .5f;
                }
                Vector3 _prePos = Pos;
                Pos += _deltaDis * _dir;
                Vector3 _detalMove = _deltaDis * _dir;
                Pos += _detalMove;
            }
            if (OnPathFinding != null)