Esempio n. 1
0
    // Helper function to show/hide or enable/disable layer depending on HideLayersWithoutVisiblePatches
    public void EnableLayerPanel(DataLayerPanel layerPanel, bool enable)
    {
        if (hideInactiveLayers)
        {
            // Show the group BEFORE the layer is shown
            if (hideEmptyGroups && enable && layerPanel.gameObject.activeSelf != enable)
            {
                GetGroupPanel(layerPanel).Show(true);
            }

            if (layerPanel.ShowLayerPanel(enable))
            {
                // Hide the group AFTER the layer is hidden (only if no other layers are visible)
                if (hideEmptyGroups && !enable)
                {
                    GetGroupPanel(layerPanel).UpdateVisibility();
                }
            }
        }
        else
        {
            layerPanel.EnableLayerPanel(enable);
        }
    }