Ejemplo n.º 1
0
    public void ExpandAll()
    {
        if (this.blocks.IsExpanding || this.planes.IsExpanding)
        {
            return;
        }

        if (expandedState == (ExpandedState.Horizontall | ExpandedState.Vertically))
        {
            blocks.ExpandAll(-ExpandingCoefficient);
            planes.ExpandAll(-ExpandingCoefficient);
            expandedState = ExpandedState.None;
            return;
        }
        if (expandedState == ExpandedState.None)
        {
            blocks.ExpandAll(ExpandingCoefficient);
            planes.ExpandAll(ExpandingCoefficient);
            expandedState = ExpandedState.Horizontall | ExpandedState.Vertically;
            return;
        }
        if ((expandedState & ExpandedState.Horizontall) == ExpandedState.Horizontall)
        {
            blocks.ExpandVert(ExpandingCoefficient);
            planes.ExpandVert(ExpandingCoefficient);
            expandedState |= ExpandedState.Vertically;
        }
        if ((expandedState & ExpandedState.Vertically) == ExpandedState.Vertically)
        {
            blocks.ExpandHoriz(ExpandingCoefficient);
            planes.ExpandHoriz(ExpandingCoefficient);
            expandedState |= ExpandedState.Horizontall;
        }
    }
Ejemplo n.º 2
0
        protected static ExpandedState SaveExpandedStateHelper(T variable, IDictionary <string, bool> dictStates)
        {
            if (!variable.Expanded || !variable.Variables.Any())
            {
                return(null);
            }

            if (string.IsNullOrEmpty(variable.UniqueName))
            {
                return(null);
            }

            if (!dictStates.ContainsKey(variable.UniqueName))
            {
                dictStates.Add(variable.UniqueName, true);
            }

            var state = new ExpandedState(variable);

            foreach (var child in variable.Variables.Select(v => v.As <T>()))
            {
                var newState = SaveExpandedStateHelper(child, dictStates);
                if (newState == null)
                {
                    continue;
                }

                state.Children.Add(newState);
            }

            return(state);
        }
Ejemplo n.º 3
0
        protected void OnEnable()
        {
            HDRaytracingEnvironment rtEnv = (HDRaytracingEnvironment)target;

            // Get & automatically add additional HD data if not present
            m_SerializedHDRaytracingEnvironment = new SerializedHDRaytracingEnvironment(rtEnv);

            k_ExpandedState = new ExpandedState <Expandable, HDRaytracingEnvironment>(~(-1), "HDRP");
        }
Ejemplo n.º 4
0
            private static void GetFlattenedHierarchyHelper(ExpandedState state, ICollection <ExpandedState> lstStates)
            {
                lstStates.Add(state);

                foreach (var child in state.Children)
                {
                    GetFlattenedHierarchyHelper(child, lstStates);
                }
            }
Ejemplo n.º 5
0
        void OnEnable()
        {
            k_Foldouts = new(k_ExpandableDefault, "APV");

            m_SearchField = new SearchField();
            titleContent  = new GUIContent("Probe Volume Settings (Experimental)");

            RefreshSceneAssets();
            m_DrawHorizontalSplitter = typeof(EditorGUIUtility).GetMethod("DrawHorizontalSplitter", BindingFlags.NonPublic | BindingFlags.Static);

            Undo.undoRedoPerformed -= RefreshAfterUndo;
            Undo.undoRedoPerformed += RefreshAfterUndo;
        }
Ejemplo n.º 6
0
    public void ExpandVertically()
    {
        if (this.blocks.IsExpanding || this.planes.IsExpanding)
        {
            return;
        }

        bool isExpandedV = (expandedState & ExpandedState.Vertically) == ExpandedState.Vertically;

        blocks.ExpandVert(isExpandedV ? -ExpandingCoefficient : ExpandingCoefficient);
        planes.ExpandVert(isExpandedV ? -ExpandingCoefficient : ExpandingCoefficient);

        if (isExpandedV)
        {
            expandedState ^= ExpandedState.Vertically;
        }
        else
        {
            expandedState |= ExpandedState.Vertically;
        }
    }
Ejemplo n.º 7
0
    public void ExpandHorizontally()
    {
        if (this.blocks.IsExpanding || this.planes.IsExpanding)
        {
            return;
        }

        bool isExpandedH = (expandedState & ExpandedState.Horizontall) == ExpandedState.Horizontall;

        blocks.ExpandHoriz(isExpandedH ? -ExpandingCoefficient : ExpandingCoefficient);
        planes.ExpandHoriz(isExpandedH ? -ExpandingCoefficient : ExpandingCoefficient);

        if (isExpandedH)
        {
            expandedState ^= ExpandedState.Horizontall;
        }
        else
        {
            expandedState |= ExpandedState.Horizontall;
        }
    }