From 73e998b35edbc101366c40860269c6f96e78e559 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期六, 16 三月 2019 15:28:15 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Fight/Stage/MapEditor/Game/ClientSceneManager.cs |   53 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/Fight/Stage/MapEditor/Game/ClientSceneManager.cs b/Fight/Stage/MapEditor/Game/ClientSceneManager.cs
index cac547e..4e7a52f 100644
--- a/Fight/Stage/MapEditor/Game/ClientSceneManager.cs
+++ b/Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -250,13 +250,58 @@
         return null;
     }
 
+    private List<MapTrasfer> m_ChkedList = new List<MapTrasfer>();
+
+    public Vector3 GetTransPoint(Vector3 start, Vector3 next)
+    {
+        m_ChkedList.Clear();
+
+        return GetNext(start, next);
+    }
+
+    private Vector3 GetNext(Vector3 start, Vector3 next)
+    {
+        Vector3 _targetPos = Vector3.zero;
+        // 閬嶅巻瀵绘壘鍒板彲绉诲姩鑷崇洰鏍囩偣鐨勮烦璺冪偣
+        foreach (var _t in m_MapData.transfers)
+        {
+            if (m_ChkedList.Contains(_t))
+            {
+                continue;
+            }
+
+            for (int i = 0; i < _t.transferPoints.Length; ++i)
+            {
+                if (PathFinder.WalkAble(next, _t.transferPoints[i].position))
+                {
+                    if (i == 0)
+                    {
+                        _targetPos = _t.transferPoints[_t.transferPoints.Length - 1].position;
+                    }
+                    else
+                    {
+                        _targetPos = _t.transferPoints[0].position;
+                    }
+                    m_ChkedList.Add(_t);
+                    break;
+                }
+            }
+            if (_targetPos != Vector3.zero)
+            {
+                break;
+            }
+        }
+
+        if (!PathFinder.WalkAble(start, _targetPos))
+        {
+            return GetNext(start, _targetPos);
+        }
+
+        return _targetPos;
+    }
 
     public Vector3 GetCloseTransPoint(Vector3 pos)
     {
-        // 閬嶅巻鎵惧埌绂荤粰瀹氱偣鏈�杩戝苟涓斿彲瀵昏矾鑷崇殑浼犻�佺偣 P
-        // 鎵惧埌 P鐐圭殑 鍙︿竴绔� P1
-        // 鍒ゆ柇褰撳墠浼犲叆鐨勭偣鏄惁鍙互瀵昏矾鑷� P1
-        // 涓嶈鐨勮瘽閲嶆柊瀵绘壘 鍙互鐨勮瘽杩斿洖 P1 鐨勫潗鏍�
         Vector3 _targetPos = Vector3.zero;
 
         foreach (var _t in m_MapData.transfers)

--
Gitblit v1.8.0