| Fight/MapTransferUtility.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WorldMap/LocalMapFindPath.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WorldMap/LocalMapTag.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Fight/MapTransferUtility.cs
@@ -890,7 +890,7 @@ } } public void MoveToLocalMapPosition(Vector3 _position) public void MoveToLocalMapPosition(Vector2 _position) { var hero = PlayerDatas.Instance.hero; if (GA_Hero.s_MapSwitching || hero == null) System/WorldMap/LocalMapFindPath.cs
@@ -69,7 +69,8 @@ mapMatrix = new LocalMap(mapId, mapWidth, mapHeight, uiMapWidth, uiMapHeight); DrawWayPoints(); DrawFunctionNPCs(); DrawFunctionNpcs(); DrawJumpPoints(); DrawEventPoints(); m_HeroHead.transform.SetAsLastSibling(); FoucsEventPoint(model.selectedMapEventPoint); @@ -255,20 +256,12 @@ var behaviour = LocalMapTagPool.Require(npcType); tagBehaviours.Add(behaviour); if (npcType == LocalMapTag.TagType.Boss) { behaviour.Display(eventPointConfig.NPCID, (TextColType)eventPointConfig.Colour, npcPos); } else { behaviour.Display(npcConfig.NPCID, (TextColType)eventPointConfig.Colour); } behaviour.Display(npcType == LocalMapTag.TagType.Boss ? eventPointConfig.NPCID : npcConfig.NPCID, (TextColType)eventPointConfig.Colour); var pathPointPos = mapMatrix.WorldToLocalPosition(npcPos); behaviour.transform.SetParentEx(m_LocalMapRect, pathPointPos, Quaternion.identity, Vector3.one); behaviour.gameObject.SetActive(true); } private void DrawWayPoints() { @@ -295,7 +288,7 @@ behaviour.gameObject.SetActive(true); } private void DrawFunctionNPCs() private void DrawFunctionNpcs() { var npcRefreshIds = model.GetMapNPCRefreshIds(mapId); if (npcRefreshIds != null) @@ -304,12 +297,12 @@ { var config = mapnpcConfig.Get(item); var npcConfig = NPCConfig.Get(config.NPCID); DrawFunctionNPC(item); DrawFunctionNpc(item); } } } private void DrawFunctionNPC(string _refreshId) private void DrawFunctionNpc(string _refreshId) { var mapNpcConfig = mapnpcConfig.Get(_refreshId); @@ -325,6 +318,41 @@ behaviour.Display(mapNpcConfig.NPCID, TextColType.White); } private void DrawJumpPoints() { var mapData = H2Engine.MapData.LoadFormFile(mapId); if (mapData == null) { return; } var transfers = mapData.transfers; var jumpPoints = new List<Vector3>(); foreach (var transfer in transfers) { foreach (var transferPoint in transfer.transferPoints) { jumpPoints.Add(transferPoint.position); } } foreach (var jumpPoint in jumpPoints) { DrawJumpPoint(jumpPoint); } } private void DrawJumpPoint(Vector3 position) { var behaviour = LocalMapTagPool.Require(LocalMapTag.TagType.JumpPoint); tagBehaviours.Add(behaviour); var pathPointPos = mapMatrix.WorldToLocalPosition(position); behaviour.transform.SetParentEx(m_LocalMapRect, pathPointPos, Quaternion.identity, Vector3.one); behaviour.gameObject.SetActive(true); behaviour.Display(position); } private void UpdateHeroPosition() { if (mapId == PlayerDatas.Instance.baseData.MapID) System/WorldMap/LocalMapTag.cs
@@ -27,14 +27,24 @@ int npcId = 0; int index = 0; Vector3 jumpPoint = Vector3.zero; MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } } TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } } FairyLeagueModel fairyLeagueModel { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } } private void Start() { if (m_Moveto != null) { m_Moveto.SetListener(MoveTo); } } public void Display(int npcId, TextColType colorType) { this.npcId = npcId; var config = NPCConfig.Get(this.npcId); switch (m_TagType) { case TagType.Function: @@ -59,17 +69,19 @@ case TagType.WayPoint: break; case TagType.Boss: m_NpcName.text = config.charName; m_Level.text = Language.Get("HeadUpName_Monster", config.NPCLV); m_NpcName.colorType = colorType; var dangerous = PlayerDatas.Instance.baseData.LV <= config.NPCLV; m_Level.color = UIHelper.GetUIColor(dangerous ? TextColType.Red : TextColType.Green, false); break; case TagType.Elite: case TagType.Monster: var config = NPCConfig.Get(this.npcId); m_NpcName.text = config.charName; m_NpcName.colorType = colorType; break; case TagType.Crystal: this.OnCrystalStateChange(this.npcId); m_Moveto.RemoveAllListeners(); m_Moveto.AddListener(MoveTo); PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent; PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent; fairyLeagueModel.UpdateWarCrystalEvent -= OnCrystalStateChange; @@ -78,34 +90,14 @@ } } public void Display(int npcId, TextColType colorType, Vector3 _position) public void Display(Vector3 position) { this.npcId = npcId; switch (m_TagType) { case TagType.Boss: var config = NPCConfig.Get(this.npcId); m_NpcName.text = config.charName; m_Level.text = Language.Get("HeadUpName_Monster", config.NPCLV); m_NpcName.colorType = colorType; var dangerous = PlayerDatas.Instance.baseData.LV <= config.NPCLV; m_Level.color = UIHelper.GetUIColor(dangerous ? TextColType.Red : TextColType.Green, false); m_Moveto.SetListener(MoveTo); break; default: break; } jumpPoint = position; } public void Display(int index) { this.index = index; switch (m_TagType) { case TagType.FairyLeagueBuff: m_Moveto.SetListener(MoveTo); break; } } public void Dispose() @@ -159,6 +151,9 @@ hero.MoveToPosition(new Vector3(buffPos.x, hero.Pos.y, buffPos.y)); } } break; case TagType.JumpPoint: MapTransferUtility.Instance.MoveToLocalMapPosition(new Vector3(jumpPoint.x, jumpPoint.z, 0) * 2); break; default: { @@ -233,6 +228,7 @@ WayPoint = 5, Crystal = 6, FairyLeagueBuff = 7, JumpPoint = 8 } }