public void Init(PlanetPanel panel, EditorArea[] areas, uint mapId) { m_Panel = panel; m_GamingMapId = mapId; m_PlanetAreas.Clear(); if (areas != null && areas.Length > 0) { EditorPlanet planet = m_Panel.m_Root.GetPreviewPlanet(mapId); if (planet != null) { m_MiniMapSize = planet.minimapSize; m_FixedStarRes = planet.bgmapRes; m_FixedStarScale = planet.bgmapScale.ToVector2(); if (m_FixedStarContainer != null) { m_FixedStarContainer.rectTransform.sizeDelta = m_FixedStarScale; } m_FixedStarPos = planet.bgmapPos.ToVector2(); m_FixedStarObj = StarMapEditorRoot.FindResAsset(m_FixedStarRes); } for (int iArea = 0; iArea < areas.Length; iArea++) { EditorArea editorArea = areas[iArea]; if (editorArea == null) { continue; } CreateElement(editorArea, planet); } } RefreshMap(); }
public void Init(EditorArea area, EditorStarMapArea starMapArea) { if (area == null) { return; } if (rectTrans == null) { rectTrans = GetComponent <RectTransform>(); } if (starMapArea != null) { m_Res = starMapArea.area_res; rectTrans.anchoredPosition = starMapArea.position.ToVector2(); m_Resobj = StarMapEditorRoot.FindResAsset(m_Res); } m_AreaData = area; gameObject.name = area.areaName; if (m_Tip == null) { Transform tipTrans = transform.Find("tip"); if (tipTrans != null) { m_Tip = tipTrans.gameObject.GetComponent <Text>(); } } if (m_Tip != null) { m_Tip.text = ""; EditorLeap[] leaps = area.leapList; if (leaps != null && leaps.Length > 0) { EditorLeap leap = leaps[0]; if (leap.leapType == (int)LeapType.Main) { m_Tip.text = "主"; } else if (leap.leapType == (int)LeapType.Child) { m_Tip.text = "副"; } } } }
public void Init(EditorGamingMap gamingData, EditorPlanet planet) { if (gamingData == null) { return; } m_StarData = gamingData; gameObject.name = gamingData.gamingmapName; if (m_RectTrans == null) { m_RectTrans = GetComponent <RectTransform>(); } if (planet != null) { m_Res = planet.gamingmapRes; m_RectTrans.anchoredPosition = planet.position.ToVector2(); m_ResScale = planet.scale.ToVector2(); m_RectTrans.sizeDelta = m_ResScale; m_ResObj = StarMapEditorRoot.FindResAsset(m_Res); } }