| | |
| | | base.Done(vNetPack); |
| | | var package = vNetPack as HB106_tagMCNotifyPlayerMove; |
| | | |
| | | MapTransferUtility.Instance.Clear(); |
| | | if (PlayerDatas.Instance.hero == null |
| | | || package == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Vector3 _pos = new Vector3((package.PosX - GA_Hero.MapOffset.x) * .5f, 0, (package.PosY - GA_Hero.MapOffset.z) * .5f); |
| | | PlayerDatas.Instance.hero.MoveToPosition(_pos); |
| | | MapTransferUtility.Instance.Clear(); |
| | | |
| | | if (package.NPCID != 0) |
| | | { |
| | | MapTransferUtility.Instance.MapTransferDoType = MapTransferUtility.E_MapTransferDoType.Npc; |
| | | MapTransferUtility.Instance.NpcID = (int)package.NPCID; |
| | | GAStaticDefine.NPCLocation _npcLocation; |
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation((int)package.NPCID, out _npcLocation); |
| | | if (_findLocation) |
| | | { |
| | | Vector3 _destPos = new Vector3(_npcLocation.position.x, PlayerDatas.Instance.hero.Pos.y, _npcLocation.position.y); |
| | | PlayerDatas.Instance.hero.MoveToPosition(_destPos, _npcLocation.scope); |
| | | MapTransferUtility.Instance.MapTransferDoType = MapTransferUtility.E_MapTransferDoType.Npc; |
| | | MapTransferUtility.Instance.NpcID = (int)package.NPCID; |
| | | } |
| | | else |
| | | { |
| | | DebugEx.LogWarningFormat("找不到NPCID: {0} 在Npc刷新表中的配置", package.NPCID); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Vector3 _pos = new Vector3((package.PosX - GA_Hero.MapOffset.x) * .5f, 0, (package.PosY - GA_Hero.MapOffset.z) * .5f); |
| | | PlayerDatas.Instance.hero.MoveToPosition(_pos); |
| | | } |
| | | |
| | | } |