少年修仙传客户端代码仓库
client_linchunjie
2019-04-25 d78f044a780441b4365a3bef03e4d392c89e63da
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)