| | |
| | | mapMatrix = new LocalMap(mapId, mapWidth, mapHeight, uiMapWidth, uiMapHeight);
|
| | |
|
| | | DrawWayPoints();
|
| | | DrawFunctionNPCs();
|
| | | DrawFunctionNpcs();
|
| | | DrawJumpPoints();
|
| | | DrawEventPoints();
|
| | | m_HeroHead.transform.SetAsLastSibling();
|
| | | FoucsEventPoint(model.selectedMapEventPoint);
|
| | |
| | |
|
| | | 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()
|
| | | {
|
| | |
| | | behaviour.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private void DrawFunctionNPCs()
|
| | | private void DrawFunctionNpcs()
|
| | | {
|
| | | var npcRefreshIds = model.GetMapNPCRefreshIds(mapId);
|
| | | if (npcRefreshIds != null)
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | |
| | | 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)
|