Пример #1
0
    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);
    }
Пример #2
0
 public void RemoveLayerController(MapLayerController layerController)
 {
     layerControllers.Remove(layerController);
 }
Пример #3
0
    //
    // Public Methods
    //

    public void AddLayerController(MapLayerController layerController)
    {
        layerController.transform.SetParent(transform, false);
        layerControllers.Add(layerController);
    }