Ejemplo n.º 1
0
    private bool FindLayer(string layerName, ref DataLayer layer, bool add = false)
    {
        if (dataLayers.HasLayer(layerName))
        {
            layer = dataLayers.GetLayer(layerName);
            if (layer != null)
            {
                return(true);
            }

            Debug.LogError("Data layer '" + layerName + "' is null");
        }
        else if (add && networkLayer != null)
        {
            var dataManager = ComponentManager.Instance.Get <DataManager>();
            layer = new DataLayer(dataManager, layerName, networkLayer.Color, networkLayer.Group);             //+ Don't use network Color
            layer.SetIsTemp(true);
            dataLayers.RebuildList(dataManager.groups);
            return(true);
        }

        ShowError(new MessageBuilder(BuildRequiredLayerMessage, layerName));
        ResetTool(true);
        return(false);
    }