From 2a7cba1a672dd99f591b284127b1bf5c7292e4a4 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 12 三月 2019 17:01:29 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Fight/Stage/MapEditor/Game/ClientSceneManager.cs |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/Fight/Stage/MapEditor/Game/ClientSceneManager.cs b/Fight/Stage/MapEditor/Game/ClientSceneManager.cs
index eba8026..0dc9d5e 100644
--- a/Fight/Stage/MapEditor/Game/ClientSceneManager.cs
+++ b/Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -13,6 +13,7 @@
     private Dictionary<int, TriggerHandler> m_TriggerHandlerDict = new Dictionary<int, TriggerHandler>();
     private List<int> m_ReadyRemoveTriggerList = new List<int>();
     private Dictionary<int, List<GActorNpcFight>> m_EventActorDict = new Dictionary<int, List<GActorNpcFight>>();
+    public bool IsClientFightMode { get; private set; }
 
     private IEnumerator DelayUnTrigger(int id)
     {
@@ -131,6 +132,7 @@
             int _triggerID = (int)package.DictValue;
             if (_triggerID == 0)
             {
+                Debug.LogFormat("閫�鍑哄綋鍓嶈Е鍙戜簨浠�, 宸茶Е鍙戞暟閲�: {0}", m_TriggerIDToMissionIDDict.Count);
                 foreach (var _removeTriggerID in m_TriggerIDToMissionIDDict.Keys)
                 {
                     SnxxzGame.Instance.StartCoroutine(DelayUnTrigger(_removeTriggerID));
@@ -147,10 +149,12 @@
             if (package.DictValue == 0)
             {
                 Debug.LogFormat("=           閫�鍑轰簡鍓嶇妯″紡             =");
+                IsClientFightMode = false;
             }
             else
             {
                 Debug.LogFormat("=           杩涘叆浜嗗墠绔ā寮�             =");
+                IsClientFightMode = true;
             }
         }
     }
@@ -246,21 +250,44 @@
         return null;
     }
 
+
     public Vector3 GetCloseTransPoint(Vector3 pos)
     {
         // 閬嶅巻鎵惧埌绂荤粰瀹氱偣鏈�杩戝苟涓斿彲瀵昏矾鑷崇殑浼犻�佺偣 P
         // 鎵惧埌 P鐐圭殑 鍙︿竴绔� P1
         // 鍒ゆ柇褰撳墠浼犲叆鐨勭偣鏄惁鍙互瀵昏矾鑷� P1
         // 涓嶈鐨勮瘽閲嶆柊瀵绘壘 鍙互鐨勮瘽杩斿洖 P1 鐨勫潗鏍�
-        float _compareDis;
-        float _dis;
+        Vector3 _targetPos = Vector3.zero;
 
-        foreach (var _p in m_TransferGroupList)
+        foreach (var _t in m_MapData.transfers)
         {
-
+            for (int i = 0; i < _t.transferPoints.Length; ++i)
+            {
+                if (PathFinder.WalkAble(pos, _t.transferPoints[i].position))
+                {
+                    if (i == 0)
+                    {
+                        _targetPos = _t.transferPoints[_t.transferPoints.Length - 1].position;
+                    }
+                    else
+                    {
+                        _targetPos = _t.transferPoints[0].position;
+                    }
+                    break;
+                }
+            }
+            if (_targetPos != Vector3.zero)
+            {
+                break;
+            }
         }
 
-        return Vector3.zero;
+        if (_targetPos == Vector3.zero)
+        {
+            Debug.LogWarningFormat("瀵绘壘鏈�杩戠殑瀵昏矾椋炶穬鐐�, 娌℃湁鎵惧埌浠讳綍缁撴灉...");
+        }
+
+        return _targetPos;
     }
 
     private IEnumerator DelayTrigger(uint missionID, int triggerID)

--
Gitblit v1.8.0