UnityEditor.EditorGUILayout.EndFadeGroup C# (CSharp) Method

EndFadeGroup() public static method

Closes a group started with BeginFadeGroup.

public static EndFadeGroup ( ) : void
return void
        public static void EndFadeGroup()
        {
            GUILayoutFadeGroup topLevel = EditorGUILayoutUtilityInternal.topLevel as GUILayoutFadeGroup;
            if (topLevel != null)
            {
                GUI.EndGroup();
                EditorGUIUtility.UnlockContextWidth();
                GUI.enabled = topLevel.wasGUIEnabled;
                GUI.color = topLevel.guiColor;
                GUILayoutUtility.EndLayoutGroup();
            }
        }

Usage Example

        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            this.m_lightmapSettings.Update();
            EditorGUILayout.Space();
            this.m_ShowEditor = EditorGUILayout.FoldoutTitlebar(this.m_ShowEditor, Styles.environmentHeader);
            if (this.m_ShowEditor)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(this.m_SkyboxMaterial, Styles.skyboxLabel, new GUILayoutOption[0]);
                Material objectReferenceValue = this.m_SkyboxMaterial.objectReferenceValue as Material;
                if ((objectReferenceValue != null) && !EditorMaterialUtility.IsBackgroundMaterial(objectReferenceValue))
                {
                    EditorGUILayout.HelpBox(Styles.skyboxWarning.text, MessageType.Warning);
                }
                EditorGUILayout.PropertyField(this.m_Sun, Styles.sunLabel, new GUILayoutOption[0]);
                EditorGUILayout.Space();
                EditorGUILayout.IntPopup(this.m_AmbientMode, Styles.kFullAmbientModes, Styles.kFullAmbientModeValues, Styles.ambientModeLabel, new GUILayoutOption[0]);
                EditorGUI.indentLevel++;
                switch (((AmbientMode)this.m_AmbientMode.intValue))
                {
                case AmbientMode.Trilight:
                {
                    EditorGUI.BeginChangeCheck();
                    Color color  = EditorGUILayout.ColorField(Styles.ambientUp, this.m_AmbientSkyColor.colorValue, true, false, true, ColorPicker.defaultHDRConfig, new GUILayoutOption[0]);
                    Color color2 = EditorGUILayout.ColorField(Styles.ambientMid, this.m_AmbientEquatorColor.colorValue, true, false, true, ColorPicker.defaultHDRConfig, new GUILayoutOption[0]);
                    Color color3 = EditorGUILayout.ColorField(Styles.ambientDown, this.m_AmbientGroundColor.colorValue, true, false, true, ColorPicker.defaultHDRConfig, new GUILayoutOption[0]);
                    if (EditorGUI.EndChangeCheck())
                    {
                        this.m_AmbientSkyColor.colorValue     = color;
                        this.m_AmbientEquatorColor.colorValue = color2;
                        this.m_AmbientGroundColor.colorValue  = color3;
                    }
                    break;
                }

                case AmbientMode.Flat:
                {
                    EditorGUI.BeginChangeCheck();
                    Color color4 = EditorGUILayout.ColorField(Styles.ambient, this.m_AmbientSkyColor.colorValue, true, false, true, ColorPicker.defaultHDRConfig, new GUILayoutOption[0]);
                    if (EditorGUI.EndChangeCheck())
                    {
                        this.m_AmbientSkyColor.colorValue = color4;
                    }
                    break;
                }

                case AmbientMode.Skybox:
                    if (objectReferenceValue == null)
                    {
                        EditorGUI.BeginChangeCheck();
                        Color color5 = EditorGUILayout.ColorField(Styles.ambient, this.m_AmbientSkyColor.colorValue, true, false, true, ColorPicker.defaultHDRConfig, new GUILayoutOption[0]);
                        if (EditorGUI.EndChangeCheck())
                        {
                            this.m_AmbientSkyColor.colorValue = color5;
                        }
                    }
                    else
                    {
                        EditorGUILayout.Slider(this.m_AmbientIntensity, 0f, 8f, Styles.ambientIntensity, new GUILayoutOption[0]);
                    }
                    break;
                }
                EditorGUI.indentLevel--;
                this.m_ShowAmbientBakeMode.target = ShowAmbientField();
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowAmbientBakeMode.faded))
                {
                    bool flag = Lightmapping.realtimeGI && Lightmapping.bakedGI;
                    using (new EditorGUI.DisabledScope(!flag))
                    {
                        if (flag)
                        {
                            EditorGUILayout.PropertyField(this.m_EnvironmentLightingMode, Styles.SkyLightBaked, new GUILayoutOption[0]);
                        }
                        else
                        {
                            int index = !Lightmapping.bakedGI ? 0 : 1;
                            EditorGUILayout.LabelField(Styles.SkyLightBaked, GUIContent.Temp(this.m_EnvironmentLightingMode.enumNames[index]), EditorStyles.popup, new GUILayoutOption[0]);
                        }
                    }
                }
                EditorGUILayout.EndFadeGroup();
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(this.m_DefaultReflectionMode, Styles.reflectionModeLabel, new GUILayoutOption[0]);
                EditorGUI.indentLevel++;
                Cubemap cubemap = this.m_CustomReflection.objectReferenceValue as Cubemap;
                UnityEditor.DefaultReflectionMode intValue = (UnityEditor.DefaultReflectionMode) this.m_DefaultReflectionMode.intValue;
                if (((objectReferenceValue == null) && (intValue == UnityEditor.DefaultReflectionMode.FromSkybox)) || ((cubemap == null) && (intValue == UnityEditor.DefaultReflectionMode.Custom)))
                {
                    EditorGUILayout.HelpBox(Styles.defReflectionWarning.text, MessageType.Warning);
                }
                if (intValue == UnityEditor.DefaultReflectionMode.FromSkybox)
                {
                    GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinWidth(40f) };
                    EditorGUILayout.IntPopup(this.m_DefaultReflectionResolution, Styles.defaultReflectionSizes, Styles.defaultReflectionSizesValues, Styles.defaultReflectionResolution, options);
                }
                else if (intValue == UnityEditor.DefaultReflectionMode.Custom)
                {
                    EditorGUILayout.PropertyField(this.m_CustomReflection, Styles.customReflection, new GUILayoutOption[0]);
                }
                EditorGUILayout.PropertyField(this.m_ReflectionCompression, Styles.ReflectionCompression, new GUILayoutOption[0]);
                EditorGUI.indentLevel--;
                EditorGUILayout.Slider(this.m_ReflectionIntensity, 0f, 1f, Styles.reflectionIntensity, new GUILayoutOption[0]);
                EditorGUILayout.IntSlider(this.m_ReflectionBounces, 1, 5, Styles.reflectionBounces, new GUILayoutOption[0]);
                EditorGUI.indentLevel--;
                base.serializedObject.ApplyModifiedProperties();
                this.m_lightmapSettings.ApplyModifiedProperties();
            }
        }
All Usage Examples Of UnityEditor.EditorGUILayout::EndFadeGroup