| | |
| | |
|
| | | Vector3 _destPostion = Vector3.zero;
|
| | |
|
| | | var _curStage = StageLoad.Instance.currentStage as DungeonStage;
|
| | |
|
| | | // 判断是否能够得到到达指定点
|
| | | // 获取NPC位置数据
|
| | | GAStaticDefine.NPCLocation _npcLocation;
|
| | |
| | | _nextMapID);
|
| | | if (_transportID != -1)
|
| | | {
|
| | | var _curStage = StageLoad.Instance.currentStage as DungeonStage;
|
| | | if (_curStage)
|
| | | {
|
| | | Vector3 _moveToPos;
|
| | |
| | | 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
|