少年修仙传客户端代码仓库
client_Hale
2019-03-25 4534825e23c2dac117e8de04d3bb1eae64dffd33
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("移动至NPC: {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