少年修仙传客户端代码仓库
client_Hale
2019-03-30 748619f513595244d93d9f2e773ba39b2719ff32
382 飞跃点寻路逻辑修改
1个文件已修改
31 ■■■■■ 已修改文件
Fight/Stage/MapEditor/Game/ClientSceneManager.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -262,9 +262,10 @@
    private List<MapTrasfer> m_ChkedList = new List<MapTrasfer>();
    private List<MapTrasfer> m_ChkedList1 = new List<MapTrasfer>();
    private int count = 0;
    public Vector3 GetTransPoint(Vector3 start, Vector3 next)
    {
        count = 0;
        m_ChkedList.Clear();
        return GetNext(start, next);
@@ -442,6 +443,11 @@
    private Vector3 GetNext(Vector3 start, Vector3 next)
    {
        count += 1;
        if (count > 20 || next == Vector3.zero)
        {
            return Vector3.zero;
        }
        Vector3 _targetPos = Vector3.zero;
        // 遍历寻找到可移动至目标点的跳跃点
        foreach (var _t in m_MapData.transfers)
@@ -453,7 +459,8 @@
            for (int i = 0; i < _t.transferPoints.Length; ++i)
            {
                if (PathFinder.WalkAble(next, _t.transferPoints[i].position))
                var _tp = _t.transferPoints[i];
                if (PathFinder.WalkAble(next, _tp.position))
                {
                    if (i == 0)
                    {
@@ -463,19 +470,19 @@
                    {
                        _targetPos = _t.transferPoints[0].position;
                    }
                    m_ChkedList.Add(_t);
                    break;
                    if (PathFinder.WalkAble(start, _targetPos))
                    {
                        return _targetPos;
                    }
                    else
                    {
                        _targetPos = GetNext(start, _targetPos);
                    }
                }
            }
            if (_targetPos != Vector3.zero)
            {
                break;
            }
        }
        if (!PathFinder.WalkAble(start, _targetPos))
        {
            return GetNext(start, _targetPos);
        }
        return _targetPos;