private MapLayerController GetOrCreateMapLayerController(MapLayerController prefab) { Type t = prefab.GetType(); foreach (var controller in layerControllers) { if (t.IsInstanceOfType(controller)) { return(controller); } } // Create Layer Controller var newController = Instantiate(prefab); newController.name = prefab.name; newController.Init(this); return(newController); }
public void RemoveLayerController(MapLayerController layerController) { layerControllers.Remove(layerController); }
// // Public Methods // public void AddLayerController(MapLayerController layerController) { layerController.transform.SetParent(transform, false); layerControllers.Add(layerController); }