public void OpenPanel(MapData data) { if (data == null) { data = new MapData(); data.InitMap(); } this.mapData = data; ui.SetActive(true); CreateMap(); ctrl.GetStartEndItem(mapItems); }
public CreateView(Transform parent, MapData data) { ctrl = new CreateCtrl(this); this.parent = parent; var prefab = Resources.Load <GameObject>("Prefabs/CreatePanel"); ui = GameObject.Instantiate(prefab, parent); if (data == null) { mapData = new MapData(); mapData.InitMap(); } else { mapData = data; } mapItems = new List <MapItem>(); CreateMap(); ctrl.GetStartEndItem(mapItems); AddBtnListener(); }