コード例 #1
0
    private void OnPatchVisibilityChange(DataLayer dataLayer, Patch patch, bool visible)
    {
        if (visible && filterPanel != null)
        {
            bool categorizedPatch;
            if (patch.Data is GridData gridData)
            {
                categorizedPatch = gridData.IsCategorized;
            }
            else if (patch.Data is PointData pointData)
            {
                categorizedPatch = pointData.IsCategorized;
            }
            else
            {
                return;
            }

            if (categorizedPatch ^ categorizedPanel)
            {
                Destroy(filterPanel.gameObject);
                filterPanel = null;

                if (IsFilterToggleOn)
                {
                    CreateFilterPanel(categorizedPatch);
                }
            }
        }
    }
コード例 #2
0
ファイル: DataLayerPanel.cs プロジェクト: gicait/ur-scape
    //
    // Private Methods
    //

    private void CreateFilterPanel(bool categorized)
    {
        categorizedPanel = categorized;

        if (categorized)
        {
            filterPanel = Instantiate(categorizedPanelPrefab, transform, false);
        }
        else
        {
            filterPanel = Instantiate(continuousPanelPrefab, transform, false);
        }
        filterPanel.Init(dataLayer);
    }
コード例 #3
0
ファイル: DataLayerPanel.cs プロジェクト: gicait/ur-scape
    private void OnPatchVisibilityChange(DataLayer dataLayer, Patch patch, bool visible)
    {
        if (visible && filterPanel != null)
        {
            if (patch.Data is GridData)
            {
                bool categorizedPatch = (patch.Data as GridData).IsCategorized;
                if (categorizedPatch ^ categorizedPanel)
                {
                    Destroy(filterPanel.gameObject);
                    filterPanel = null;

                    if (IsFilterToggleOn)
                    {
                        CreateFilterPanel(categorizedPatch);
                    }
                }
            }
        }
    }