From 4534825e23c2dac117e8de04d3bb1eae64dffd33 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期一, 25 三月 2019 21:08:01 +0800
Subject: [PATCH] 382 寻路逻辑增加又可跳跃又可走到的目标点的距离检测判断
---
Fight/MapTransferUtility.cs | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/Fight/MapTransferUtility.cs b/Fight/MapTransferUtility.cs
index afa0f4a..2c2471e 100644
--- a/Fight/MapTransferUtility.cs
+++ b/Fight/MapTransferUtility.cs
@@ -266,6 +266,8 @@
Vector3 _destPostion = Vector3.zero;
+ var _curStage = StageLoad.Instance.currentStage as DungeonStage;
+
// 鍒ゆ柇鏄惁鑳藉寰楀埌鍒拌揪鎸囧畾鐐�
// 鑾峰彇NPC浣嶇疆鏁版嵁
GAStaticDefine.NPCLocation _npcLocation;
@@ -327,7 +329,6 @@
_nextMapID);
if (_transportID != -1)
{
- var _curStage = StageLoad.Instance.currentStage as DungeonStage;
if (_curStage)
{
Vector3 _moveToPos;
@@ -380,14 +381,39 @@
Debug.LogErrorFormat("绉诲姩鑷砃PC: {0} 鏃舵壘涓嶅埌涓�涓彲浠ュ埌杈剧殑鐐�.", NpcID);
yield break;
}
+
float _dist = 0.01f;
var _config = NPCConfig.Get(NpcID);
if (_config != null)
{
_dist = Mathf.Max(GeneralDefine.CloseNpcDist + _config.ModelRadius - 0.3f, 0);
}
+
if (PathFinder.WalkAble(_hero.Pos, _destPostion, _dist) || NpcID == 32504001)
{
+ while (true)
+ {
+ Vector3 _nextPos = ClientSceneManager.Instance.GetNext1(_hero.Pos, _destPostion);
+ if (_nextPos == Vector3.zero)
+ {
+ break;
+ }
+ float _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
+ while (_dis > 0.01f)
+ {
+ _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
+ _hero.MoveToPosition(_nextPos);
+ yield return null;
+ }
+ while (!GA_Hero.s_Flying)
+ {
+ yield return null;
+ }
+ while (GA_Hero.s_Flying)
+ {
+ yield return null;
+ }
+ }
_MoveToNPC(NpcID, sid);
}
else
--
Gitblit v1.8.0