少年修仙传客户端代码仓库
client_Hale
2019-04-29 520b305dd91ba067a2f9182e6ae863b3147166ed
382 跳跃点寻路逻辑修改
1个文件已修改
18 ■■■■ 已修改文件
Fight/Stage/MapEditor/Game/ClientSceneManager.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -266,9 +266,15 @@
    private List<MapTrasfer> m_ChkedList = new List<MapTrasfer>();
    private List<MapTrasfer> m_ChkedList1 = new List<MapTrasfer>();
    private int count = 0;
    // 是否已经找到了一个可以移动到目标的点
    // 因为可能存在多个, 这里加一个标识,可以在此路不通的时候另寻他路
    private bool hasFindWalkable = false;
    private Vector3 m_DestPos;
    public Vector3 GetTransPoint(Vector3 start, Vector3 next)
    {
        count = 0;
        hasFindWalkable = false;
        m_DestPos = next;
        m_ChkedList.Clear();
        return GetNext(start, next);
@@ -470,7 +476,6 @@
                var _tp = _t.transferPoints[i];
                if (PathFinder.WalkAble(next, _tp.position))
                {
                    //Debug.Log("_tp.position : " + _tp.position);
                    if (i == 0)
                    {
                        _targetPos = _t.transferPoints[_t.transferPoints.Length - 1].position;
@@ -486,6 +491,7 @@
            }
            if (_targetPos != Vector3.zero)
            {
                hasFindWalkable = true;
                break;
            }
        }
@@ -496,7 +502,15 @@
        }
        else
        {
            _targetPos = GetNext(start, _targetPos);
            if (hasFindWalkable)
            {
                hasFindWalkable = false;
                _targetPos = GetNext(start, m_DestPos);
            }
            else
            {
                _targetPos = GetNext(start, _targetPos);
            }
        }
        //Debug.Log("_targetPos: " + _targetPos);