IntPopup() public static method

Make an integer popup selection field.

public static IntPopup ( GUIContent label, int selectedValue, GUIContent displayedOptions, int optionValues ) : int
label UnityEngine.GUIContent Optional label in front of the field.
selectedValue int The value of the option the field shows.
displayedOptions UnityEngine.GUIContent An array with the displayed options the user can choose from.
optionValues int An array with the values for each option.
return int
        public override void OnInspectorGUI()
        {
            if (m_Images == null)
            {
                InitTexturesFromCubemap();
            }

            EditorGUIUtility.labelWidth = 50;
            var c = target as Cubemap;

            if (c == null)
            {
                return;
            }

            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            ShowFace("Right\n(+X)", CubemapFace.PositiveX);
            ShowFace("Left\n(-X)", CubemapFace.NegativeX);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            ShowFace("Top\n(+Y)", CubemapFace.PositiveY);
            ShowFace("Bottom\n(-Y)", CubemapFace.NegativeY);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            ShowFace("Front\n(+Z)", CubemapFace.PositiveZ);
            ShowFace("Back\n(-Z)", CubemapFace.NegativeZ);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();

            EditorGUIUtility.labelWidth = 0;

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.HelpBox("Lowering face size is a destructive operation, you might need to re-assign the textures later to fix resolution issues. It's preferable to use Cubemap texture import type instead of Legacy Cubemap assets.", MessageType.Warning);
            int faceSize = TextureUtil.GetGPUWidth(c);

            faceSize = EditorGUILayout.IntPopup("Face size", faceSize, kSizes, kSizesValues);

            int  mipMaps   = TextureUtil.GetMipmapCount(c);
            bool useMipMap = EditorGUILayout.Toggle("MipMaps", mipMaps > 1);

            bool streamingMipmaps = TextureUtil.GetCubemapStreamingMipmaps(c);

            if (useMipMap)
            {
                streamingMipmaps = EditorGUILayout.Toggle(EditorGUIUtility.TrTextContent("Streaming Mip Maps", "Don't load image data immediately, but wait till image data is requested from script."), streamingMipmaps);
            }

            bool linear = TextureUtil.GetLinearSampled(c);

            linear = EditorGUILayout.Toggle("Linear", linear);

            bool readable = TextureUtil.IsCubemapReadable(c);

            readable = EditorGUILayout.Toggle("Readable", readable);

            if (EditorGUI.EndChangeCheck())
            {
                // reformat the cubemap
                if (TextureUtil.ReformatCubemap(ref c, faceSize, faceSize, c.format, useMipMap, linear))
                {
                    InitTexturesFromCubemap();
                }

                TextureUtil.MarkCubemapReadable(c, readable);
                TextureUtil.SetCubemapStreamingMipmaps(c, streamingMipmaps);
                c.Apply();
            }
        }
示例#2
0
        public override void OnInspectorGUI()
        {
            if (s_Styles == null)
            {
                s_Styles = new Styles();
            }
            base.serializedObject.Update();
            this.UpdateShowOptions(false);
            EditorGUILayout.PropertyField(this.m_Type, new GUILayoutOption[0]);
            if (EditorGUILayout.BeginFadeGroup(1f - this.m_ShowAreaOptions.faded))
            {
                EditorGUILayout.IntPopup(this.m_Lightmapping, s_Styles.LightmappingModes, s_Styles.LightmappingModeValues, s_Styles.LightmappingModeLabel, new GUILayoutOption[0]);
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowBakingWarning.faded))
                {
                    EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Enable Baked GI from Lighting window to use Baked or Mixed.").text, MessageType.Warning, false);
                }
                EditorGUILayout.EndFadeGroup();
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.Space();
            float num = !((!this.m_ShowDirOptions.isAnimating || !this.m_ShowAreaOptions.isAnimating) ? false : (this.m_ShowDirOptions.target ? true : this.m_ShowAreaOptions.target)) ? (1f - Mathf.Max(this.m_ShowDirOptions.faded, this.m_ShowAreaOptions.faded)) : 0f;

            if (EditorGUILayout.BeginFadeGroup(num))
            {
                EditorGUILayout.PropertyField(this.m_Range, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowSpotOptions.faded))
            {
                EditorGUILayout.Slider(this.m_SpotAngle, 1f, 179f, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowAreaOptions.faded))
            {
                EditorGUILayout.PropertyField(this.m_AreaSizeX, new GUIContent("Width"), new GUILayoutOption[0]);
                EditorGUILayout.PropertyField(this.m_AreaSizeY, new GUIContent("Height"), new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.PropertyField(this.m_Color, new GUILayoutOption[0]);
            EditorGUILayout.Slider(this.m_Intensity, 0f, 8f, new GUILayoutOption[0]);
            EditorGUILayout.Slider(this.m_BounceIntensity, 0f, 8f, s_Styles.LightBounceIntensity, new GUILayoutOption[0]);
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowIndirectWarning.faded))
            {
                EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Currently realtime indirect bounce light shadowing for spot and point lights is not supported.").text, MessageType.Warning, false);
            }
            EditorGUILayout.EndFadeGroup();
            this.ShadowsGUI();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowRuntimeOptions.faded))
            {
                EditorGUILayout.PropertyField(this.m_Cookie, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowRuntimeOptions.faded * this.m_ShowDirOptions.faded))
            {
                EditorGUILayout.PropertyField(this.m_CookieSize, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.PropertyField(this.m_Halo, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_Flare, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RenderMode, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_CullingMask, new GUILayoutOption[0]);
            EditorGUILayout.Space();
            if ((SceneView.currentDrawingSceneView != null) && !SceneView.currentDrawingSceneView.m_SceneLighting)
            {
                EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("One of your scene views has lighting disabled, please keep this in mind when editing lighting.").text, MessageType.Warning, false);
            }
            base.serializedObject.ApplyModifiedProperties();
        }
示例#3
0
 public void DrawTargetEye()
 {
     EditorGUILayout.IntPopup(targetEye, kTargetEyes, kTargetEyeValues, EditorGUIUtility.TempContent("Target Eye"));
 }
示例#4
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            UpdateShowOptions(false);

            var tree = ((LightProbeProxyVolume)target).GetComponent <Tree>();

            if (tree != null)
            {
                EditorGUILayout.HelpBox(Styles.componentUnsuportedOnTreesNote.text, MessageType.Info);
                return;
            }

            EditorGUILayout.Space();

            EditorGUILayout.Popup(m_RefreshMode, Styles.refreshMode, Styles.refreshModeText);

            EditorGUILayout.Popup(m_BoundingBoxMode, Styles.bbMode, Styles.bbModeText);

            if (EditorGUILayout.BeginFadeGroup(m_ShowBoundingBoxOptions.faded))
            {
                if (targets.Length == 1)
                {
                    DoToolbar();
                }

                GUILayout.Label(Styles.bbSettingsText);

                EditorGUI.indentLevel++;

                EditorGUILayout.PropertyField(m_BoundingBoxSize, Styles.sizeText);
                EditorGUILayout.PropertyField(m_BoundingBoxOrigin, Styles.originText);

                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndFadeGroup();

            EditorGUILayout.Space();

            GUILayout.Label(Styles.volumeResolutionText);

            EditorGUI.indentLevel++;
            {
                EditorGUILayout.Popup(m_ResolutionMode, Styles.resMode, Styles.resModeText);

                if (EditorGUILayout.BeginFadeGroup(m_ShowResolutionXYZOptions.faded))
                {
                    EditorGUILayout.IntPopup(m_ResolutionX, Styles.volTextureSizes, Styles.volTextureSizesValues, Styles.resolutionXText, GUILayout.MinWidth(40));
                    EditorGUILayout.IntPopup(m_ResolutionY, Styles.volTextureSizes, Styles.volTextureSizesValues, Styles.resolutionYText, GUILayout.MinWidth(40));
                    EditorGUILayout.IntPopup(m_ResolutionZ, Styles.volTextureSizes, Styles.volTextureSizesValues, Styles.resolutionZText, GUILayout.MinWidth(40));
                }
                EditorGUILayout.EndFadeGroup();

                if (EditorGUILayout.BeginFadeGroup(m_ShowResolutionProbesOption.faded))
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(m_ResolutionProbesPerUnit, Styles.resProbesPerUnit);
                    GUILayout.Label(" probes per unit", EditorStyles.wordWrappedMiniLabel);
                    GUILayout.EndHorizontal();
                }
                EditorGUILayout.EndFadeGroup();
            }

            EditorGUI.indentLevel--;

            EditorGUILayout.Space();

            EditorGUILayout.Popup(m_ProbePositionMode, Styles.probePositionMode, Styles.probePositionText);

            if (EditorGUILayout.BeginFadeGroup(m_ShowComponentUnusedWarning.faded) && LightProbeProxyVolume.isFeatureSupported)
            {
                EditorGUILayout.HelpBox(Styles.componentUnusedNote.text, MessageType.Warning);
            }
            EditorGUILayout.EndFadeGroup();

            if (EditorGUILayout.BeginFadeGroup(m_ShowNoRendererWarning.faded))
            {
                EditorGUILayout.HelpBox(Styles.noRendererNode.text, MessageType.Info);
            }
            EditorGUILayout.EndFadeGroup();

            if (EditorGUILayout.BeginFadeGroup(m_ShowNoLightProbesWarning.faded))
            {
                EditorGUILayout.HelpBox(Styles.noLightProbes.text, MessageType.Info);
            }
            EditorGUILayout.EndFadeGroup();

            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            if (!m_FormatSupported.HasValue)
            {
                m_FormatSupported = true;
                foreach (Object target in targets)
                {
                    var importer = target as TrueTypeFontImporter;
                    if (importer == null || !importer.IsFormatSupported())
                    {
                        m_FormatSupported = false;
                    }
                }
            }

            if (m_FormatSupported == false)
            {
                ShowFormatUnsupportedGUI();
                return;
            }

            EditorGUILayout.PropertyField(m_FontSize);
            if (m_FontSize.intValue < 1)
            {
                m_FontSize.intValue = 1;
            }
            if (m_FontSize.intValue > 500)
            {
                m_FontSize.intValue = 500;
            }

            EditorGUILayout.IntPopup(m_FontRenderingMode, kRenderingModeStrings, kRenderingModeValues, EditorGUIUtility.TrTextContent("Rendering Mode"));
            EditorGUILayout.IntPopup(m_TextureCase, kCharacterStrings, kCharacterValues, EditorGUIUtility.TrTextContent("Character"));
            EditorGUILayout.IntPopup(m_AscentCalculationMode, kAscentCalculationModeStrings, kAscentCalculationModeValues, EditorGUIUtility.TrTextContent("Ascent Calculation Mode"));
            EditorGUILayout.PropertyField(m_UseLegacyBoundsCalculation, EditorGUIUtility.TrTextContent("Use Legacy Bounds"));
            EditorGUILayout.PropertyField(m_ShouldRoundAdvanceValue, new GUIContent("Should Round Advance Value"));

            if (!m_TextureCase.hasMultipleDifferentValues)
            {
                if ((FontTextureCase)m_TextureCase.intValue != FontTextureCase.Dynamic)
                {
                    if ((FontTextureCase)m_TextureCase.intValue == FontTextureCase.CustomSet)
                    {
                        // Characters included
                        EditorGUI.BeginChangeCheck();
                        GUILayout.BeginHorizontal();
                        EditorGUILayout.PrefixLabel("Custom Chars");
                        EditorGUI.showMixedValue = m_CustomCharacters.hasMultipleDifferentValues;
                        string guiChars = EditorGUILayout.TextArea(m_CustomCharacters.stringValue, GUI.skin.textArea, GUILayout.MinHeight(EditorGUI.kSingleLineHeight * 2));
                        EditorGUI.showMixedValue = false;
                        GUILayout.EndHorizontal();
                        if (EditorGUI.EndChangeCheck())
                        {
                            m_CustomCharacters.stringValue = new string(guiChars.Distinct().Where(c => c != '\n' && c != '\r').ToArray());
                        }
                    }
                }
                else
                {
                    EditorGUILayout.PropertyField(m_IncludeFontData, EditorGUIUtility.TrTextContent("Incl. Font Data"));
                    // The default font names are different based on font so it'll be a mess if we show
                    // this GUI when multiple fonts are selected.
                    if (targets.Length == 1)
                    {
                        EditorGUI.BeginChangeCheck();

                        GUILayout.BeginHorizontal();
                        EditorGUILayout.PrefixLabel("Font Names");
                        GUI.SetNextControlName("fontnames");
                        m_FontNamesString = EditorGUILayout.TextArea(m_FontNamesString, "TextArea", GUILayout.MinHeight(EditorGUI.kSingleLineHeight * 2));
                        GUILayout.EndHorizontal();
                        GUILayout.BeginHorizontal();
                        GUILayout.FlexibleSpace();
                        using (new EditorGUI.DisabledScope(m_FontNamesString == m_DefaultFontNamesString))
                        {
                            if (GUILayout.Button("Reset", "MiniButton"))
                            {
                                GUI.changed = true;
                                if (GUI.GetNameOfFocusedControl() == "fontnames")
                                {
                                    GUIUtility.keyboardControl = 0;
                                }
                                m_FontNamesString = m_DefaultFontNamesString;
                            }
                        }
                        GUILayout.EndHorizontal();

                        if (EditorGUI.EndChangeCheck())
                        {
                            SetFontNames(m_FontNamesString);
                        }

                        m_ReferencesExpanded = EditorGUILayout.Foldout(m_ReferencesExpanded, "References to other fonts in project", true);
                        if (m_ReferencesExpanded)
                        {
                            EditorGUILayout.HelpBox("These are automatically generated by the inspector if any of the font names you supplied match fonts present in your project, which will then be used as fallbacks for this font.", MessageType.Info);

                            using (new EditorGUI.DisabledScope(true))
                            {
                                if (m_FallbackFontReferences != null && m_FallbackFontReferences.Length > 0)
                                {
                                    for (int i = 0; i < m_FallbackFontReferences.Length; ++i)
                                    {
                                        EditorGUILayout.ObjectField(m_FallbackFontReferences[i], typeof(Font), false);
                                    }
                                }
                                else
                                {
                                    GUILayout.Label("No references to other fonts in project.");
                                }
                            }
                        }
                    }
                }
            }

            ApplyRevertGUI();
        }
示例#6
0
        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, kFullAmbientModes, kFullAmbientModeValues, Styles.ambientModeLabel, new GUILayoutOption[0]);
                EditorGUI.indentLevel++;
                switch (this.m_AmbientMode.intValue)
                {
                case 0:
                    if (objectReferenceValue == null)
                    {
                        EditorGUILayout.PropertyField(this.m_AmbientSkyColor, Styles.ambient, new GUILayoutOption[0]);
                    }
                    break;

                case 1:
                    EditorGUILayout.PropertyField(this.m_AmbientSkyColor, Styles.ambientUp, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_AmbientEquatorColor, Styles.ambientMid, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_AmbientGroundColor, Styles.ambientDown, new GUILayoutOption[0]);
                    break;

                case 3:
                    EditorGUILayout.PropertyField(this.m_AmbientSkyColor, Styles.ambient, new GUILayoutOption[0]);
                    break;
                }
                EditorGUI.indentLevel--;
                EditorGUILayout.Slider(this.m_AmbientIntensity, 0f, 8f, Styles.ambientIntensity, new GUILayoutOption[0]);
                this.m_ShowAmbientBakeMode.target = ShowAmbientField();
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowAmbientBakeMode.faded))
                {
                    bool flag = Lightmapping.realtimeLightmapsEnabled && Lightmapping.bakedLightmapsEnabled;
                    EditorGUI.BeginDisabledGroup(!flag);
                    if (flag)
                    {
                        EditorGUILayout.PropertyField(this.m_EnvironmentLightingMode, Styles.SkyLightBaked, new GUILayoutOption[0]);
                    }
                    else
                    {
                        int index = !Lightmapping.bakedLightmapsEnabled ? 0 : 1;
                        EditorGUILayout.LabelField(Styles.SkyLightBaked, GUIContent.Temp(this.m_EnvironmentLightingMode.enumNames[index]), EditorStyles.popup, new GUILayoutOption[0]);
                    }
                    EditorGUI.EndDisabledGroup();
                }
                EditorGUILayout.EndFadeGroup();
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(this.m_DefaultReflectionMode, Styles.reflectionModeLabel, new GUILayoutOption[0]);
                EditorGUI.indentLevel++;
                switch (((DefaultReflectionMode)this.m_DefaultReflectionMode.intValue))
                {
                case DefaultReflectionMode.FromSkybox:
                {
                    GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinWidth(40f) };
                    EditorGUILayout.IntPopup(this.m_DefaultReflectionResolution, Styles.defaultReflectionSizes, Styles.defaultReflectionSizesValues, Styles.defaultReflectionResolution, options);
                    break;
                }

                case DefaultReflectionMode.Custom:
                    EditorGUILayout.PropertyField(this.m_CustomReflection, Styles.customReflection, new GUILayoutOption[0]);
                    break;
                }
                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();
            }
        }
示例#7
0
 public override void OnInspectorGUI()
 {
     if (!this.m_FormatSupported.HasValue)
       {
     this.m_FormatSupported = new bool?(true);
     foreach (Object target in this.targets)
     {
       TrueTypeFontImporter typeFontImporter = target as TrueTypeFontImporter;
       if ((Object) typeFontImporter == (Object) null || !typeFontImporter.IsFormatSupported())
     this.m_FormatSupported = new bool?(false);
     }
       }
       bool? formatSupported = this.m_FormatSupported;
       if ((formatSupported.GetValueOrDefault() ? 0 : (formatSupported.HasValue ? 1 : 0)) != 0)
       {
     this.ShowFormatUnsupportedGUI();
       }
       else
       {
     EditorGUILayout.PropertyField(this.m_FontSize);
     if (this.m_FontSize.intValue < 1)
       this.m_FontSize.intValue = 1;
     if (this.m_FontSize.intValue > 500)
       this.m_FontSize.intValue = 500;
     EditorGUILayout.IntPopup(this.m_FontRenderingMode, TrueTypeFontImporterInspector.kRenderingModeStrings, TrueTypeFontImporterInspector.kRenderingModeValues, new GUIContent("Rendering Mode"), new GUILayoutOption[0]);
     EditorGUILayout.IntPopup(this.m_TextureCase, TrueTypeFontImporterInspector.kCharacterStrings, TrueTypeFontImporterInspector.kCharacterValues, new GUIContent("Character"), new GUILayoutOption[0]);
     EditorGUILayout.IntPopup(this.m_AscentCalculationMode, TrueTypeFontImporterInspector.kAscentCalculationModeStrings, TrueTypeFontImporterInspector.kAscentCalculationModeValues, new GUIContent("Ascent Calculation Mode"), new GUILayoutOption[0]);
     if (!this.m_TextureCase.hasMultipleDifferentValues)
     {
       if (this.m_TextureCase.intValue != -2)
       {
     if (this.m_TextureCase.intValue == 3)
     {
       EditorGUI.BeginChangeCheck();
       GUILayout.BeginHorizontal();
       EditorGUILayout.PrefixLabel("Custom Chars");
       EditorGUI.showMixedValue = this.m_CustomCharacters.hasMultipleDifferentValues;
       string source = EditorGUILayout.TextArea(this.m_CustomCharacters.stringValue, GUI.skin.textArea, GUILayout.MinHeight(32f));
       EditorGUI.showMixedValue = false;
       GUILayout.EndHorizontal();
       if (EditorGUI.EndChangeCheck())
         this.m_CustomCharacters.stringValue = new string(source.Distinct<char>().ToArray<char>()).Replace("\n", string.Empty).Replace("\r", string.Empty);
     }
       }
       else
       {
     EditorGUILayout.PropertyField(this.m_IncludeFontData, new GUIContent("Incl. Font Data"), new GUILayoutOption[0]);
     if (this.targets.Length == 1)
     {
       EditorGUI.BeginChangeCheck();
       GUILayout.BeginHorizontal();
       EditorGUILayout.PrefixLabel("Font Names");
       GUI.SetNextControlName("fontnames");
       this.m_FontNamesString = EditorGUILayout.TextArea(this.m_FontNamesString, (GUIStyle) "TextArea", GUILayout.MinHeight(32f));
       GUILayout.EndHorizontal();
       GUILayout.BeginHorizontal();
       GUILayout.FlexibleSpace();
       EditorGUI.BeginDisabledGroup(this.m_FontNamesString == this.m_DefaultFontNamesString);
       if (GUILayout.Button("Reset", (GUIStyle) "MiniButton", new GUILayoutOption[0]))
       {
         GUI.changed = true;
         if (GUI.GetNameOfFocusedControl() == "fontnames")
           GUIUtility.keyboardControl = 0;
         this.m_FontNamesString = this.m_DefaultFontNamesString;
       }
       EditorGUI.EndDisabledGroup();
       GUILayout.EndHorizontal();
       if (EditorGUI.EndChangeCheck())
         this.SetFontNames(this.m_FontNamesString);
       this.m_ReferencesExpanded = EditorGUILayout.Foldout(this.m_ReferencesExpanded, "References to other fonts in project");
       if (this.m_ReferencesExpanded)
       {
         EditorGUILayout.HelpBox("These are automatically generated by the inspector if any of the font names you supplied match fonts present in your project, which will then be used as fallbacks for this font.", MessageType.Info);
         if (this.m_FallbackFontReferencesArraySize.intValue > 0)
         {
           SerializedProperty property = this.m_FallbackFontReferencesArraySize.Copy();
           while (property.NextVisible(true) && property.depth == 1)
             EditorGUILayout.PropertyField(property, true, new GUILayoutOption[0]);
         }
         else
         {
           EditorGUI.BeginDisabledGroup(true);
           GUILayout.Label("No references to other fonts in project.");
           EditorGUI.EndDisabledGroup();
         }
       }
     }
       }
     }
     this.ApplyRevertGUI();
       }
 }
示例#8
0
 internal RealtimeGICPUUsage RealtimeGICPUUsagePopup(RealtimeGICPUUsage usage)
 {
     return((RealtimeGICPUUsage)EditorGUILayout.IntPopup((int)usage, GraphicsSettingsWindow.TierSettingsEditor.Styles.realtimeGICPUUsageName, GraphicsSettingsWindow.TierSettingsEditor.Styles.realtimeGICPUUsageValue, new GUILayoutOption[0]));
 }
示例#9
0
 public void DrawRenderingPath()
 {
     EditorGUILayout.IntPopup(this.renderingPath, CameraEditor.Settings.kCameraRenderPaths, CameraEditor.Settings.kCameraRenderPathValues, EditorGUIUtility.TempContent("Rendering Path"), new GUILayoutOption[0]);
 }
示例#10
0
 internal RenderingPath RenderingPathPopup(RenderingPath rp)
 {
     return((RenderingPath)EditorGUILayout.IntPopup((int)rp, GraphicsSettingsWindow.TierSettingsEditor.Styles.renderingPathName, GraphicsSettingsWindow.TierSettingsEditor.Styles.renderingPathValue, new GUILayoutOption[0]));
 }
示例#11
0
 internal CameraHDRMode HDRModePopup(CameraHDRMode mode)
 {
     return((CameraHDRMode)EditorGUILayout.IntPopup((int)mode, GraphicsSettingsWindow.TierSettingsEditor.Styles.hdrModeName, GraphicsSettingsWindow.TierSettingsEditor.Styles.hdrModeValue, new GUILayoutOption[0]));
 }
示例#12
0
 internal ShaderQuality ShaderQualityPopup(ShaderQuality sq)
 {
     return((ShaderQuality)EditorGUILayout.IntPopup((int)sq, GraphicsSettingsWindow.TierSettingsEditor.Styles.shaderQualityName, GraphicsSettingsWindow.TierSettingsEditor.Styles.shaderQualityValue, new GUILayoutOption[0]));
 }
        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            if (base.targets.Length == 1)
            {
                this.DoToolbar();
            }
            this.m_ShowProbeModeRealtimeOptions.target = (this.reflectionProbeMode == ReflectionProbeMode.Realtime);
            this.m_ShowProbeModeCustomOptions.target   = (this.reflectionProbeMode == ReflectionProbeMode.Custom);
            EditorGUILayout.IntPopup(this.m_Mode, ReflectionProbeEditor.Styles.reflectionProbeMode, ReflectionProbeEditor.Styles.reflectionProbeModeValues, ReflectionProbeEditor.Styles.typeText, new GUILayoutOption[0]);
            if (!this.m_Mode.hasMultipleDifferentValues)
            {
                EditorGUI.indentLevel++;
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowProbeModeCustomOptions.faded))
                {
                    EditorGUILayout.PropertyField(this.m_RenderDynamicObjects, ReflectionProbeEditor.Styles.renderDynamicObjects, new GUILayoutOption[0]);
                    EditorGUI.BeginChangeCheck();
                    EditorGUI.showMixedValue = this.m_CustomBakedTexture.hasMultipleDifferentValues;
                    UnityEngine.Object objectReferenceValue = EditorGUILayout.ObjectField(ReflectionProbeEditor.Styles.customCubemapText, this.m_CustomBakedTexture.objectReferenceValue, typeof(Cubemap), false, new GUILayoutOption[0]);
                    EditorGUI.showMixedValue = false;
                    if (EditorGUI.EndChangeCheck())
                    {
                        this.m_CustomBakedTexture.objectReferenceValue = objectReferenceValue;
                    }
                }
                EditorGUILayout.EndFadeGroup();
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowProbeModeRealtimeOptions.faded))
                {
                    EditorGUILayout.PropertyField(this.m_RefreshMode, ReflectionProbeEditor.Styles.refreshMode, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_TimeSlicingMode, ReflectionProbeEditor.Styles.timeSlicing, new GUILayoutOption[0]);
                    EditorGUILayout.Space();
                }
                EditorGUILayout.EndFadeGroup();
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.Space();
            GUILayout.Label(ReflectionProbeEditor.Styles.runtimeSettingsHeader, new GUILayoutOption[0]);
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(this.m_Importance, ReflectionProbeEditor.Styles.importanceText, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_IntensityMultiplier, ReflectionProbeEditor.Styles.intensityText, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_BoxProjection, ReflectionProbeEditor.Styles.boxProjectionText, new GUILayoutOption[0]);
            bool flag  = SceneView.IsUsingDeferredRenderingPath();
            bool flag2 = flag && UnityEngine.Rendering.GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections) != BuiltinShaderMode.Disabled;

            using (new EditorGUI.DisabledScope(!flag2))
            {
                EditorGUILayout.PropertyField(this.m_BlendDistance, ReflectionProbeEditor.Styles.blendDistanceText, new GUILayoutOption[0]);
            }
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowBoxOptions.faded))
            {
                EditorGUI.BeginChangeCheck();
                EditorGUILayout.PropertyField(this.m_BoxSize, ReflectionProbeEditor.Styles.sizeText, new GUILayoutOption[0]);
                EditorGUILayout.PropertyField(this.m_BoxOffset, ReflectionProbeEditor.Styles.centerText, new GUILayoutOption[0]);
                if (EditorGUI.EndChangeCheck())
                {
                    Vector3 vector3Value  = this.m_BoxOffset.vector3Value;
                    Vector3 vector3Value2 = this.m_BoxSize.vector3Value;
                    if (this.ValidateAABB(ref vector3Value, ref vector3Value2))
                    {
                        this.m_BoxOffset.vector3Value = vector3Value;
                        this.m_BoxSize.vector3Value   = vector3Value2;
                    }
                }
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
            GUILayout.Label(ReflectionProbeEditor.Styles.captureCubemapHeaderText, new GUILayoutOption[0]);
            EditorGUI.indentLevel++;
            EditorGUILayout.IntPopup(this.m_Resolution, ReflectionProbeEditor.Styles.renderTextureSizes.ToArray(), ReflectionProbeEditor.Styles.renderTextureSizesValues.ToArray(), ReflectionProbeEditor.Styles.resolutionText, new GUILayoutOption[]
            {
                GUILayout.MinWidth(40f)
            });
            EditorGUILayout.PropertyField(this.m_HDR, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_ShadowDistance, new GUILayoutOption[0]);
            EditorGUILayout.IntPopup(this.m_ClearFlags, ReflectionProbeEditor.Styles.clearFlags, ReflectionProbeEditor.Styles.clearFlagsValues, ReflectionProbeEditor.Styles.clearFlagsText, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_BackgroundColor, ReflectionProbeEditor.Styles.backgroundColorText, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_CullingMask, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_UseOcclusionCulling, new GUILayoutOption[0]);
            EditorGUILayout.PropertiesField(EditorGUI.s_ClipingPlanesLabel, this.m_NearAndFarProperties, EditorGUI.s_NearAndFarLabels, 35f, new GUILayoutOption[0]);
            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
            if (base.targets.Length == 1)
            {
                ReflectionProbe reflectionProbe = (ReflectionProbe)this.target;
                if (reflectionProbe.mode == ReflectionProbeMode.Custom && reflectionProbe.customBakedTexture != null)
                {
                    Cubemap cubemap = reflectionProbe.customBakedTexture as Cubemap;
                    if (cubemap && cubemap.mipmapCount == 1)
                    {
                        EditorGUILayout.HelpBox("No mipmaps in the cubemap, Smoothness value in Standard shader will be ignored.", MessageType.Warning);
                    }
                }
            }
            this.DoBakeButton();
            EditorGUILayout.Space();
            base.serializedObject.ApplyModifiedProperties();
        }
示例#14
0
        protected void OnRenderTextureGUI(GUIElements guiElements)
        {
            GUI.changed = false;

            bool isTexture3D = (m_Dimension.intValue == (int)UnityEngine.Rendering.TextureDimension.Tex3D);

            EditorGUILayout.IntPopup(m_Dimension, styles.dimensionStrings, styles.dimensionValues, styles.dimension);

            GUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel(styles.size, EditorStyles.popup);
            EditorGUILayout.DelayedIntField(m_Width, GUIContent.none, GUILayout.MinWidth(40));
            GUILayout.Label(styles.cross);
            EditorGUILayout.DelayedIntField(m_Height, GUIContent.none, GUILayout.MinWidth(40));
            if (isTexture3D)
            {
                GUILayout.Label(styles.cross);
                EditorGUILayout.DelayedIntField(m_Depth, GUIContent.none, GUILayout.MinWidth(40));
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            if ((guiElements & GUIElements.RenderTargetAAGUI) != 0)
            {
                EditorGUILayout.IntPopup(m_AntiAliasing, styles.renderTextureAntiAliasing, styles.renderTextureAntiAliasingValues, styles.antiAliasing);
            }

            GraphicsFormat format           = (GraphicsFormat)m_ColorFormat.intValue;
            GraphicsFormat compatibleFormat = SystemInfo.GetCompatibleFormat(format, FormatUsage.Render);

            using (new EditorGUI.DisabledScope(compatibleFormat == GraphicsFormat.None))
                EditorGUILayout.PropertyField(m_EnableCompatibleFormat, styles.enableCompatibleFormat);

            EditorGUILayout.PropertyField(m_ColorFormat, styles.colorFormat);

            if (compatibleFormat != format)
            {
                string text = string.Format("Format {0} is not supported on this platform. ", format.ToString());
                if (compatibleFormat != GraphicsFormat.None)
                {
                    if (m_EnableCompatibleFormat.boolValue)
                    {
                        text += string.Format("Using {0} as a compatible format.", compatibleFormat.ToString());
                    }
                    else
                    {
                        text += string.Format("You may enable Compatible Color Format to fallback automatically to a platform specific compatible format, {0} on this device.", compatibleFormat.ToString());
                    }
                }
                EditorGUILayout.HelpBox(text, m_EnableCompatibleFormat.boolValue && compatibleFormat != GraphicsFormat.None ? MessageType.Warning : MessageType.Error);
            }

            if ((guiElements & GUIElements.RenderTargetDepthGUI) != 0)
            {
                EditorGUILayout.PropertyField(m_DepthFormat, styles.depthBuffer);
            }

            m_sRGB.boolValue = GraphicsFormatUtility.IsSRGBFormat(format);

            using (new EditorGUI.DisabledScope(isTexture3D))
            {
                EditorGUILayout.PropertyField(m_EnableMipmaps, styles.enableMipmaps);
                using (new EditorGUI.DisabledScope(!m_EnableMipmaps.boolValue))
                    EditorGUILayout.PropertyField(m_AutoGeneratesMipmaps, styles.autoGeneratesMipmaps);
            }

            if (isTexture3D)
            {
                // Mip map generation is not supported yet for 3D textures.
                EditorGUILayout.HelpBox("3D RenderTextures do not support Mip Maps.", MessageType.Info);
            }

            EditorGUILayout.PropertyField(m_UseDynamicScale, styles.useDynamicScale);

            var rt = target as RenderTexture;

            if (GUI.changed && rt != null)
            {
                rt.Release();
            }

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            DoWrapModePopup();
            DoFilterModePopup();

            using (new EditorGUI.DisabledScope(RenderTextureHasDepth())) // Render Textures with depth are forced to 0 Aniso Level
            {
                DoAnisoLevelSlider();
            }
            if (RenderTextureHasDepth())
            {
                // RenderTextures don't enforce this nicely. RenderTexture only forces Aniso to 0 if the gfx card
                // supports depth, rather than forcing Aniso to zero depending on what the user asks of the RT. If the
                // user requests any kind of depth then we will force aniso to zero here.
                m_Aniso.intValue = 0;
                EditorGUILayout.HelpBox("RenderTextures with depth must have an Aniso Level of 0.", MessageType.Info);
            }

            if (EditorGUI.EndChangeCheck())
            {
                ApplySettingsToTextures();
            }
        }
        // showPerAxisWrapModes is state of whether "Per-Axis" mode should be active in the main dropdown.
        // It is set automatically if wrap modes in UVW are different, or if user explicitly picks "Per-Axis" option -- when that one is picked,
        // then it should stay true even if UVW wrap modes will initially be the same.
        //
        // Note: W wrapping mode is only shown when isVolumeTexture is true.
        internal static void WrapModePopup(SerializedProperty wrapU, SerializedProperty wrapV, SerializedProperty wrapW, bool isVolumeTexture, ref bool showPerAxisWrapModes)
        {
            if (s_Styles == null)
            {
                s_Styles = new Styles();
            }

            // In texture importer settings, serialized properties for things like wrap modes can contain -1;
            // that seems to indicate "use defaults, user has not changed them to anything" but not totally sure.
            // Show them as Repeat wrap modes in the popups.
            var wu = (TextureWrapMode)Mathf.Max(wrapU.intValue, 0);
            var wv = (TextureWrapMode)Mathf.Max(wrapV.intValue, 0);
            var ww = (TextureWrapMode)Mathf.Max(wrapW.intValue, 0);

            // automatically go into per-axis mode if values are already different
            if (wu != wv)
            {
                showPerAxisWrapModes = true;
            }
            if (isVolumeTexture)
            {
                if (wu != ww || wv != ww)
                {
                    showPerAxisWrapModes = true;
                }
            }

            // It's not possible to determine whether any single texture in the whole selection is using per-axis wrap modes
            // just from SerializedProperty values. They can only tell if "some values in whole selection are different" (e.g.
            // wrap value on U axis is not the same among all textures), and can return value of "some" object in the selection
            // (typically based on object loading order). So in order for more intuitive behavior with multi-selection,
            // we go over the actual objects when there's >1 object selected and some wrap modes are different.
            if (!showPerAxisWrapModes)
            {
                if (wrapU.hasMultipleDifferentValues || wrapV.hasMultipleDifferentValues || (isVolumeTexture && wrapW.hasMultipleDifferentValues))
                {
                    if (IsAnyTextureObjectUsingPerAxisWrapMode(wrapU.serializedObject.targetObjects, isVolumeTexture))
                    {
                        showPerAxisWrapModes = true;
                    }
                }
            }

            int value = showPerAxisWrapModes ? -1 : (int)wu;

            // main wrap mode popup
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = !showPerAxisWrapModes && (wrapU.hasMultipleDifferentValues || wrapV.hasMultipleDifferentValues || (isVolumeTexture && wrapW.hasMultipleDifferentValues));
            value = EditorGUILayout.IntPopup(s_Styles.wrapModeLabel, value, s_Styles.wrapModeContents, s_Styles.wrapModeValues);
            if (EditorGUI.EndChangeCheck() && value != -1)
            {
                // assign the same wrap mode to all axes, and hide per-axis popups
                wrapU.intValue       = value;
                wrapV.intValue       = value;
                wrapW.intValue       = value;
                showPerAxisWrapModes = false;
            }

            // show per-axis popups if needed
            if (value == -1)
            {
                showPerAxisWrapModes = true;
                EditorGUI.indentLevel++;
                WrapModeAxisPopup(s_Styles.wrapU, wrapU);
                WrapModeAxisPopup(s_Styles.wrapV, wrapV);
                if (isVolumeTexture)
                {
                    WrapModeAxisPopup(s_Styles.wrapW, wrapW);
                }
                EditorGUI.indentLevel--;
            }
            EditorGUI.showMixedValue = false;
        }
示例#16
0
 public void DrawTargetEye()
 {
     EditorGUILayout.IntPopup(this.targetEye, CameraEditor.Settings.kTargetEyes, CameraEditor.Settings.kTargetEyeValues, EditorGUIUtility.TempContent("Target Eye"), new GUILayoutOption[0]);
 }
示例#17
0
        private void DisplayUpdateGUI()
        {
            EditorGUILayout.IntPopup(this.m_UpdateMode, CustomRenderTextureEditor.styles.updateModeStrings, CustomRenderTextureEditor.styles.updateModeValues, CustomRenderTextureEditor.styles.updateMode, new GUILayoutOption[0]);
            EditorGUI.indentLevel++;
            if (this.m_UpdateMode.intValue == 1)
            {
                EditorGUILayout.PropertyField(this.m_UpdatePeriod, CustomRenderTextureEditor.styles.updatePeriod, new GUILayoutOption[0]);
            }
            EditorGUILayout.PropertyField(this.m_DoubleBuffered, CustomRenderTextureEditor.styles.doubleBuffered, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_WrapUpdateZones, CustomRenderTextureEditor.styles.wrapUpdateZones, new GUILayoutOption[0]);
            bool flag = true;

            UnityEngine.Object[] targets = base.targets;
            for (int i = 0; i < targets.Length; i++)
            {
                UnityEngine.Object  @object             = targets[i];
                CustomRenderTexture customRenderTexture = @object as CustomRenderTexture;
                if (customRenderTexture != null && customRenderTexture.dimension != TextureDimension.Cube)
                {
                    flag = false;
                }
            }
            if (flag)
            {
                int  num      = 0;
                int  intValue = this.m_CubeFaceMask.intValue;
                Rect rect     = GUILayoutUtility.GetRect(0f, EditorGUIUtility.singleLineHeight * 3f + EditorGUIUtility.standardVerticalSpacing * 2f);
                EditorGUI.BeginProperty(rect, GUIContent.none, this.m_CubeFaceMask);
                Rect position = rect;
                position.width  = 100f;
                position.height = EditorGUIUtility.singleLineHeight;
                int  num2      = 0;
                Rect position2 = rect;
                EditorGUI.LabelField(position2, CustomRenderTextureEditor.styles.cubemapFacesLabel);
                EditorGUI.BeginChangeCheck();
                for (int j = 0; j < 3; j++)
                {
                    position.x = rect.x + EditorGUIUtility.labelWidth - 15f;
                    for (int k = 0; k < 2; k++)
                    {
                        bool flag2 = EditorGUI.ToggleLeft(position, CustomRenderTextureEditor.styles.cubemapFaces[num2], (intValue & 1 << num2) != 0);
                        if (flag2)
                        {
                            num |= 1 << num2;
                        }
                        num2++;
                        position.x += 100f;
                    }
                    position.y += EditorGUIUtility.singleLineHeight;
                }
                if (EditorGUI.EndChangeCheck())
                {
                    this.m_CubeFaceMask.intValue = num;
                }
                EditorGUI.EndProperty();
            }
            EditorGUILayout.IntPopup(this.m_UpdateZoneSpace, CustomRenderTextureEditor.styles.updateZoneSpaceStrings, CustomRenderTextureEditor.styles.updateZoneSpaceValues, CustomRenderTextureEditor.styles.updateZoneSpace, new GUILayoutOption[0]);
            if (!this.multipleEditing)
            {
                Rect rect2 = GUILayoutUtility.GetRect(0f, this.m_RectList.GetHeight() + 16f, new GUILayoutOption[]
                {
                    GUILayout.ExpandWidth(true)
                });
                float num3 = 15f;
                rect2.x     += num3;
                rect2.width -= num3;
                this.m_RectList.DoList(rect2);
            }
            else
            {
                EditorGUILayout.HelpBox("Update Zones cannot be changed while editing multiple Custom Textures.", MessageType.Info);
            }
            EditorGUI.indentLevel--;
        }
示例#18
0
 internal ShaderQuality ShaderQualityPopup(ShaderQuality sq)
 {
     return((ShaderQuality)EditorGUILayout.IntPopup((int)sq, Styles.shaderQualityName, Styles.shaderQualityValue));
 }
示例#19
0
        protected void OnRenderTextureGUI(GUIElements guiElements)
        {
            GUI.changed = false;

            bool isTexture3D = (m_Dimension.intValue == (int)UnityEngine.Rendering.TextureDimension.Tex3D);

            EditorGUILayout.IntPopup(m_Dimension, styles.dimensionStrings, styles.dimensionValues, styles.dimension);

            GUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel(styles.size, EditorStyles.popup);
            EditorGUILayout.DelayedIntField(m_Width, GUIContent.none, GUILayout.MinWidth(40));
            GUILayout.Label(styles.cross);
            EditorGUILayout.DelayedIntField(m_Height, GUIContent.none, GUILayout.MinWidth(40));
            if (isTexture3D)
            {
                GUILayout.Label(styles.cross);
                EditorGUILayout.DelayedIntField(m_Depth, GUIContent.none, GUILayout.MinWidth(40));
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            if ((guiElements & GUIElements.RenderTargetAAGUI) != 0)
            {
                EditorGUILayout.IntPopup(m_AntiAliasing, styles.renderTextureAntiAliasing, styles.renderTextureAntiAliasingValues, styles.antiAliasing);
            }
            EditorGUILayout.PropertyField(m_ColorFormat, styles.colorFormat);
            if ((guiElements & GUIElements.RenderTargetDepthGUI) != 0)
            {
                EditorGUILayout.PropertyField(m_DepthFormat, styles.depthBuffer);
            }

            bool isHDRRenderTexture = IsHDRFormat((RenderTextureFormat)m_ColorFormat.intValue);

            using (new EditorGUI.DisabledScope(isHDRRenderTexture))
            {
                EditorGUILayout.PropertyField(m_sRGB, styles.sRGBTexture);
            }

            using (new EditorGUI.DisabledScope(isTexture3D))
            {
                EditorGUILayout.PropertyField(m_EnableMipmaps, styles.enableMipmaps);
                using (new EditorGUI.DisabledScope(!m_EnableMipmaps.boolValue))
                    EditorGUILayout.PropertyField(m_AutoGeneratesMipmaps, styles.autoGeneratesMipmaps);
            }

            if (isTexture3D)
            {
                // Mip map generation is not supported yet for 3D textures.
                EditorGUILayout.HelpBox("3D RenderTextures do not support Mip Maps.", MessageType.Info);
            }

            EditorGUILayout.PropertyField(m_UseDynamicScale, styles.useDynamicScale);

            var rt = target as RenderTexture;

            if (GUI.changed && rt != null)
            {
                rt.Release();
            }

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            DoWrapModePopup();
            DoFilterModePopup();

            using (new EditorGUI.DisabledScope(RenderTextureHasDepth())) // Render Textures with depth are forced to 0 Aniso Level
            {
                DoAnisoLevelSlider();
            }
            if (RenderTextureHasDepth())
            {
                // RenderTextures don't enforce this nicely. RenderTexture only forces Aniso to 0 if the gfx card
                // supports depth, rather than forcing Aniso to zero depending on what the user asks of the RT. If the
                // user requests any kind of depth then we will force aniso to zero here.
                m_Aniso.intValue = 0;
                EditorGUILayout.HelpBox("RenderTextures with depth must have an Aniso Level of 0.", MessageType.Info);
            }

            if (EditorGUI.EndChangeCheck())
            {
                ApplySettingsToTextures();
            }
        }
示例#20
0
 internal RenderingPath RenderingPathPopup(RenderingPath rp)
 {
     return((RenderingPath)EditorGUILayout.IntPopup((int)rp, Styles.renderingPathName, Styles.renderingPathValue));
 }
示例#21
0
        private void OnSampleSettingGUI(BuildTargetGroup platform, SerializedProperty audioImporterSampleSettings, bool selectionContainsTrackerFile)
        {
            //Load Type
            var loadTypeProperty = audioImporterSampleSettings.FindPropertyRelative("loadType");

            using (var horizontal = new EditorGUILayout.HorizontalScope())
            {
                using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Style.LoadType, loadTypeProperty))
                {
                    EditorGUI.showMixedValue = loadTypeProperty.hasMultipleDifferentValues;
                    using (var changed = new EditorGUI.ChangeCheckScope())
                    {
                        var newValue = (AudioClipLoadType)EditorGUILayout.EnumPopup(propertyScope.content, (AudioClipLoadType)loadTypeProperty.intValue);
                        if (changed.changed)
                        {
                            loadTypeProperty.intValue = (int)newValue;
                        }
                    }

                    EditorGUI.showMixedValue = false;
                }
            }

            //Preload Audio Data
            // If the loadtype is streaming on the selected platform, gray out the "Preload Audio Data" option and show the checkbox as unchecked.
            bool disablePreloadAudioDataOption = (AudioClipLoadType)loadTypeProperty.intValue == AudioClipLoadType.Streaming;

            using (new EditorGUI.DisabledScope(disablePreloadAudioDataOption))
            {
                if (disablePreloadAudioDataOption)
                {
                    EditorGUILayout.Toggle("Preload Audio Data", false);
                }
                else
                {
                    EditorGUILayout.PropertyField(m_PreloadAudioData, Style.PreloadAudioData);
                }
            }

            if (!selectionContainsTrackerFile)
            {
                //Compression format
                var compressionFormatProperty = audioImporterSampleSettings.FindPropertyRelative("compressionFormat");
                var allowedFormats            = GetFormatsForPlatform(platform);
                using (var horizontal = new EditorGUILayout.HorizontalScope())
                {
                    using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Style.CompressionFormat, compressionFormatProperty))
                    {
                        EditorGUI.showMixedValue = compressionFormatProperty.hasMultipleDifferentValues;
                        using (var changed = new EditorGUI.ChangeCheckScope())
                        {
                            var newValue = (AudioCompressionFormat)EditorGUILayout.IntPopup(
                                propertyScope.content,
                                compressionFormatProperty.intValue,
                                allowedFormats.Select(a => new GUIContent(a.ToString())).ToArray(),
                                allowedFormats.Select(a => (int)a).ToArray());
                            if (changed.changed)
                            {
                                compressionFormatProperty.intValue = (int)newValue;
                            }
                        }

                        EditorGUI.showMixedValue = false;
                    }
                }

                //Quality
                if (!compressionFormatProperty.hasMultipleDifferentValues && CompressionFormatHasQuality((AudioCompressionFormat)compressionFormatProperty.intValue))
                {
                    using (var horizontal = new EditorGUILayout.HorizontalScope())
                    {
                        var property = audioImporterSampleSettings.FindPropertyRelative("quality");
                        using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Style.Quality, property))
                        {
                            EditorGUI.showMixedValue = property.hasMultipleDifferentValues;
                            using (var changed = new EditorGUI.ChangeCheckScope())
                            {
                                var newValue = EditorGUILayout.IntSlider(propertyScope.content, (int)Mathf.Clamp(property.floatValue * 100.0f, 1.0f, 100.0f), 1, 100);
                                if (changed.changed)
                                {
                                    property.floatValue = 0.01f * newValue;
                                }
                            }

                            EditorGUI.showMixedValue = false;
                        }
                    }
                }

                if (platform != BuildTargetGroup.WebGL)
                {
                    //Sample rate settings
                    var sampleRateSettingProperty = audioImporterSampleSettings.FindPropertyRelative("sampleRateSetting");
                    using (var horizontal = new EditorGUILayout.HorizontalScope())
                    {
                        using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Style.SampleRateSetting, sampleRateSettingProperty))
                        {
                            EditorGUI.showMixedValue = sampleRateSettingProperty.hasMultipleDifferentValues;
                            using (var changed = new EditorGUI.ChangeCheckScope())
                            {
                                var newValue = (AudioSampleRateSetting)EditorGUILayout.EnumPopup(propertyScope.content, (AudioSampleRateSetting)sampleRateSettingProperty.intValue);
                                if (changed.changed)
                                {
                                    sampleRateSettingProperty.intValue = (int)newValue;
                                }
                            }

                            EditorGUI.showMixedValue = false;
                        }
                    }

                    //Sample rate override settings
                    if (!sampleRateSettingProperty.hasMultipleDifferentValues && (AudioSampleRateSetting)sampleRateSettingProperty.intValue == AudioSampleRateSetting.OverrideSampleRate)
                    {
                        using (var horizontal = new EditorGUILayout.HorizontalScope())
                        {
                            var property = audioImporterSampleSettings.FindPropertyRelative("sampleRateOverride");
                            using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Style.SampleRate, property))
                            {
                                EditorGUI.showMixedValue = property.hasMultipleDifferentValues;
                                using (var changed = new EditorGUI.ChangeCheckScope())
                                {
                                    var newValue = EditorGUILayout.IntPopup(propertyScope.content, property.intValue,
                                                                            Style.kSampleRateStrings, Style.kSampleRateValues);
                                    if (changed.changed)
                                    {
                                        property.intValue = newValue;
                                    }
                                }

                                EditorGUI.showMixedValue = false;
                            }
                        }
                    }
                }

                //TODO include the settings for things like HEVAG
            }
        }
示例#22
0
 internal CameraHDRMode HDRModePopup(CameraHDRMode mode)
 {
     return((CameraHDRMode)EditorGUILayout.IntPopup((int)mode, Styles.hdrModeName, Styles.hdrModeValue));
 }
示例#23
0
        public override void OnInspectorGUI()
        {
            if (s_Styles == null)
            {
                s_Styles = new Styles();
            }
            base.serializedObject.Update();
            this.UpdateShowOptions(false);
            EditorGUILayout.PropertyField(this.m_Type, new GUILayoutOption[0]);
            if (EditorGUILayout.BeginFadeGroup(1f - this.m_ShowAreaOptions.faded))
            {
                EditorGUILayout.IntPopup(this.m_Lightmapping, s_Styles.LightmappingModes, s_Styles.LightmappingModeValues, s_Styles.LightmappingModeLabel, new GUILayoutOption[0]);
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowBakingWarning.faded))
                {
                    EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Enable Baked GI from Lighting window to use Baked or Mixed.").text, MessageType.Warning, false);
                }
                EditorGUILayout.EndFadeGroup();
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.Space();
            float num = 1f - this.m_ShowDirOptions.faded;

            if (EditorGUILayout.BeginFadeGroup(num))
            {
                if (this.m_ShowAreaOptions.target)
                {
                    GUI.enabled = false;
                    string     tooltip = "For area lights " + this.m_Range.displayName + " is computed from Width, Height and Intensity";
                    GUIContent label   = new GUIContent(this.m_Range.displayName, tooltip);
                    EditorGUILayout.FloatField(label, this.light.range, new GUILayoutOption[0]);
                    GUI.enabled = true;
                }
                else
                {
                    EditorGUILayout.PropertyField(this.m_Range, new GUILayoutOption[0]);
                }
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowSpotOptions.faded))
            {
                EditorGUILayout.Slider(this.m_SpotAngle, 1f, 179f, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowAreaOptions.faded))
            {
                EditorGUILayout.PropertyField(this.m_AreaSizeX, EditorGUIUtility.TextContent("Width"), new GUILayoutOption[0]);
                EditorGUILayout.PropertyField(this.m_AreaSizeY, EditorGUIUtility.TextContent("Height"), new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.PropertyField(this.m_Color, new GUILayoutOption[0]);
            EditorGUILayout.Slider(this.m_Intensity, 0f, 8f, new GUILayoutOption[0]);
            EditorGUILayout.Slider(this.m_BounceIntensity, 0f, 8f, s_Styles.LightBounceIntensity, new GUILayoutOption[0]);
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowIndirectWarning.faded))
            {
                EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Currently realtime indirect bounce light shadowing for spot and point lights is not supported.").text, MessageType.Warning, false);
            }
            EditorGUILayout.EndFadeGroup();
            this.ShadowsGUI();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowRuntimeOptions.faded))
            {
                EditorGUILayout.PropertyField(this.m_Cookie, new GUILayoutOption[0]);
                if (EditorGUILayout.BeginFadeGroup(this.m_ShowCookieWarning.faded))
                {
                    EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Cookie textures for spot lights should be set to clamp, not repeat, to avoid artifacts.").text, MessageType.Warning, false);
                }
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowRuntimeOptions.faded * this.m_ShowDirOptions.faded))
            {
                EditorGUILayout.PropertyField(this.m_CookieSize, new GUILayoutOption[0]);
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.PropertyField(this.m_Halo, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_Flare, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_RenderMode, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_CullingMask, new GUILayoutOption[0]);
            EditorGUILayout.Space();
            if ((SceneView.currentDrawingSceneView != null) && !SceneView.currentDrawingSceneView.m_SceneLighting)
            {
                EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("One of your scene views has lighting disabled, please keep this in mind when editing lighting.").text, MessageType.Warning, false);
            }
            this.CommandBufferGUI();
            base.serializedObject.ApplyModifiedProperties();
        }
示例#24
0
 internal RealtimeGICPUUsage RealtimeGICPUUsagePopup(RealtimeGICPUUsage usage)
 {
     return((RealtimeGICPUUsage)EditorGUILayout.IntPopup((int)usage, Styles.realtimeGICPUUsageName, Styles.realtimeGICPUUsageValue));
 }
 public override void OnInspectorGUI()
 {
     if (!this.m_FormatSupported.HasValue)
     {
         this.m_FormatSupported = new bool?(true);
         UnityEngine.Object[] targets = base.targets;
         for (int i = 0; i < targets.Length; i++)
         {
             UnityEngine.Object   @object = targets[i];
             TrueTypeFontImporter trueTypeFontImporter = @object as TrueTypeFontImporter;
             if (trueTypeFontImporter == null || !trueTypeFontImporter.IsFormatSupported())
             {
                 this.m_FormatSupported = new bool?(false);
             }
         }
     }
     if (this.m_FormatSupported == false)
     {
         this.ShowFormatUnsupportedGUI();
     }
     else
     {
         EditorGUILayout.PropertyField(this.m_FontSize, new GUILayoutOption[0]);
         if (this.m_FontSize.intValue < 1)
         {
             this.m_FontSize.intValue = 1;
         }
         if (this.m_FontSize.intValue > 500)
         {
             this.m_FontSize.intValue = 500;
         }
         EditorGUILayout.IntPopup(this.m_FontRenderingMode, TrueTypeFontImporterInspector.kRenderingModeStrings, TrueTypeFontImporterInspector.kRenderingModeValues, EditorGUIUtility.TrTextContent("Rendering Mode", null, null), new GUILayoutOption[0]);
         EditorGUILayout.IntPopup(this.m_TextureCase, TrueTypeFontImporterInspector.kCharacterStrings, TrueTypeFontImporterInspector.kCharacterValues, EditorGUIUtility.TrTextContent("Character", null, null), new GUILayoutOption[0]);
         EditorGUILayout.IntPopup(this.m_AscentCalculationMode, TrueTypeFontImporterInspector.kAscentCalculationModeStrings, TrueTypeFontImporterInspector.kAscentCalculationModeValues, EditorGUIUtility.TrTextContent("Ascent Calculation Mode", null, null), new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.m_UseLegacyBoundsCalculation, EditorGUIUtility.TrTextContent("Use Legacy Bounds", null, null), new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.m_ShouldRoundAdvanceValue, new GUIContent("Should Round Advance Value"), new GUILayoutOption[0]);
         if (!this.m_TextureCase.hasMultipleDifferentValues)
         {
             if (this.m_TextureCase.intValue != -2)
             {
                 if (this.m_TextureCase.intValue == 3)
                 {
                     EditorGUI.BeginChangeCheck();
                     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                     EditorGUILayout.PrefixLabel("Custom Chars");
                     EditorGUI.showMixedValue = this.m_CustomCharacters.hasMultipleDifferentValues;
                     string source = EditorGUILayout.TextArea(this.m_CustomCharacters.stringValue, GUI.skin.textArea, new GUILayoutOption[]
                     {
                         GUILayout.MinHeight(32f)
                     });
                     EditorGUI.showMixedValue = false;
                     GUILayout.EndHorizontal();
                     if (EditorGUI.EndChangeCheck())
                     {
                         this.m_CustomCharacters.stringValue = new string((from c in source.Distinct <char>()
                                                                           where c != '\n' && c != '\r'
                                                                           select c).ToArray <char>());
                     }
                 }
             }
             else
             {
                 EditorGUILayout.PropertyField(this.m_IncludeFontData, EditorGUIUtility.TrTextContent("Incl. Font Data", null, null), new GUILayoutOption[0]);
                 if (base.targets.Length == 1)
                 {
                     EditorGUI.BeginChangeCheck();
                     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                     EditorGUILayout.PrefixLabel("Font Names");
                     GUI.SetNextControlName("fontnames");
                     this.m_FontNamesString = EditorGUILayout.TextArea(this.m_FontNamesString, "TextArea", new GUILayoutOption[]
                     {
                         GUILayout.MinHeight(32f)
                     });
                     GUILayout.EndHorizontal();
                     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                     GUILayout.FlexibleSpace();
                     using (new EditorGUI.DisabledScope(this.m_FontNamesString == this.m_DefaultFontNamesString))
                     {
                         if (GUILayout.Button("Reset", "MiniButton", new GUILayoutOption[0]))
                         {
                             GUI.changed = true;
                             if (GUI.GetNameOfFocusedControl() == "fontnames")
                             {
                                 GUIUtility.keyboardControl = 0;
                             }
                             this.m_FontNamesString = this.m_DefaultFontNamesString;
                         }
                     }
                     GUILayout.EndHorizontal();
                     if (EditorGUI.EndChangeCheck())
                     {
                         this.SetFontNames(this.m_FontNamesString);
                     }
                     this.m_ReferencesExpanded = EditorGUILayout.Foldout(this.m_ReferencesExpanded, "References to other fonts in project", true);
                     if (this.m_ReferencesExpanded)
                     {
                         EditorGUILayout.HelpBox("These are automatically generated by the inspector if any of the font names you supplied match fonts present in your project, which will then be used as fallbacks for this font.", MessageType.Info);
                         using (new EditorGUI.DisabledScope(true))
                         {
                             if (this.m_FallbackFontReferences != null && this.m_FallbackFontReferences.Length > 0)
                             {
                                 for (int j = 0; j < this.m_FallbackFontReferences.Length; j++)
                                 {
                                     EditorGUILayout.ObjectField(this.m_FallbackFontReferences[j], typeof(Font), false, new GUILayoutOption[0]);
                                 }
                             }
                             else
                             {
                                 GUILayout.Label("No references to other fonts in project.", new GUILayoutOption[0]);
                             }
                         }
                     }
                 }
             }
         }
         base.ApplyRevertGUI();
     }
 }
        public void DeveloperBuildSettingsGUI()
        {
            if (!Unsupported.IsDeveloperMode())
            {
                return;
            }

            Lightmapping.concurrentJobsType        = (Lightmapping.ConcurrentJobsType)EditorGUILayout.IntPopup(Styles.ConcurrentJobs, (int)Lightmapping.concurrentJobsType, Styles.ConcurrentJobsTypeStrings, Styles.ConcurrentJobsTypeValues);
            Lightmapping.enlightenForceUpdates     = EditorGUILayout.Toggle(Styles.ForceUpdates, Lightmapping.enlightenForceUpdates);
            Lightmapping.enlightenForceWhiteAlbedo = EditorGUILayout.Toggle(Styles.ForceWhiteAlbedo, Lightmapping.enlightenForceWhiteAlbedo);
            Lightmapping.filterMode = (FilterMode)EditorGUILayout.EnumPopup(EditorGUIUtility.TempContent("Filter Mode"), Lightmapping.filterMode);

            EditorGUILayout.Slider(m_BounceScale, 0.0f, 10.0f, Styles.BounceScale);
            EditorGUILayout.Slider(m_UpdateThreshold, 0.0f, 1.0f, Styles.UpdateThreshold);

            if (GUILayout.Button("Clear disk cache", GUILayout.Width(LightingWindow.kButtonWidth)))
            {
                Lightmapping.Clear();
                Lightmapping.ClearDiskCache();
            }

            if (GUILayout.Button("Print state to console", GUILayout.Width(LightingWindow.kButtonWidth)))
            {
                Lightmapping.PrintStateToConsole();
            }

            if (GUILayout.Button("Reset albedo/emissive", GUILayout.Width(LightingWindow.kButtonWidth)))
            {
                GIDebugVisualisation.ResetRuntimeInputTextures();
            }

            if (GUILayout.Button("Reset environment", GUILayout.Width(LightingWindow.kButtonWidth)))
            {
                DynamicGI.UpdateEnvironment();
            }
        }
示例#27
0
 public void DrawRenderingPath()
 {
     EditorGUILayout.IntPopup(renderingPath, kCameraRenderPaths, kCameraRenderPathValues, Styles.renderingPath);
 }
        void GeneralLightmapSettingsGUI()
        {
            bool bakedGISupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked);

            if (!bakedGISupported && !SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime))
            {
                return;
            }

            m_ShowGeneralLightmapSettings = EditorGUILayout.FoldoutTitlebar(m_ShowGeneralLightmapSettings, Styles.GeneralLightmapLabel, true);
            if (m_ShowGeneralLightmapSettings)
            {
                EditorGUI.indentLevel++;
                using (new EditorGUI.DisabledScope(!m_EnabledBakedGI.boolValue && !m_EnableRealtimeGI.boolValue))
                {
                    if (bakedGISupported)
                    {
                        using (new EditorGUI.DisabledScope(!m_EnabledBakedGI.boolValue))
                        {
                            EditorGUI.BeginChangeCheck();

                            //TODO(RadeonRays) Remove this when GPU lightmapper is public.

                            if (Unsupported.IsDeveloperMode() && (Application.platform == RuntimePlatform.WindowsEditor))
                            {
                                var backendOptions = new[] { "Enlighten", "Progressive CPU", "Progressive GPU (Experimental)" };
                                m_BakeBackend.intValue = EditorGUILayout.Popup(Styles.BakeBackend, m_BakeBackend.intValue, backendOptions);
                            }
                            else
                            {
                                EditorGUILayout.PropertyField(m_BakeBackend, Styles.BakeBackend);
                            }

                            if (EditorGUI.EndChangeCheck())
                            {
                                InspectorWindow.RepaintAllInspectors(); // We need to repaint other inspectors that might need to update based on the selected backend.
                            }
                            if (LightmapEditorSettings.lightmapper != LightmapEditorSettings.Lightmapper.Enlighten)
                            {
                                EditorGUI.indentLevel++;

                                EditorGUILayout.PropertyField(m_PVRCulling, Styles.PVRCulling);

                                // Sampling type
                                //EditorGUILayout.PropertyField(m_PvrSampling, Styles.m_PVRSampling); // TODO(PVR): make non-fixed sampling modes work.

                                if (LightmapEditorSettings.sampling != LightmapEditorSettings.Sampling.Auto)
                                {
                                    // Update those constants also in LightmapBake.cpp UpdateSamples().
                                    const int kMinSamples = 10;
                                    const int kMaxSamples = 100000;

                                    // Sample count
                                    // TODO(PVR): make non-fixed sampling modes work.
                                    //EditorGUI.indentLevel++;
                                    //if (LightmapEditorSettings.giPathTracerSampling == LightmapEditorSettings.PathTracerSampling.PathTracerSamplingAdaptive)
                                    //  EditorGUILayout.PropertyField(m_PVRSampleCount, Styles.PVRSampleCountAdaptive);
                                    //else

                                    EditorGUILayout.PropertyField(m_PVRDirectSampleCount, Styles.PVRDirectSampleCount);
                                    EditorGUILayout.PropertyField(m_PVRSampleCount, Styles.PVRIndirectSampleCount);

                                    if (m_PVRSampleCount.intValue < kMinSamples ||
                                        m_PVRSampleCount.intValue > kMaxSamples)
                                    {
                                        m_PVRSampleCount.intValue = Math.Max(Math.Min(m_PVRSampleCount.intValue, kMaxSamples), kMinSamples);
                                    }

                                    // TODO(PVR): make non-fixed sampling modes work.
                                    //EditorGUI.indentLevel--;
                                }

                                EditorGUILayout.IntPopup(m_PVRBounces, Styles.BouncesStrings, Styles.BouncesValues, Styles.PVRBounces);

                                // Filtering
                                EditorGUILayout.PropertyField(m_PVRFilteringMode, Styles.PVRFilteringMode);

                                if (m_PVRFilteringMode.enumValueIndex == (int)LightmapEditorSettings.FilterMode.Advanced)
                                {
                                    EditorGUI.indentLevel++;

                                    EditorGUILayout.PropertyField(m_PVRFilterTypeDirect, Styles.PVRFilterTypeDirect);
                                    DrawFilterSettingField(m_PVRFilteringGaussRadiusDirect,
                                                           m_PVRFilteringAtrousPositionSigmaDirect,
                                                           Styles.PVRFilteringGaussRadiusDirect,
                                                           Styles.PVRFilteringAtrousPositionSigmaDirect,
                                                           LightmapEditorSettings.filterTypeDirect);

                                    EditorGUILayout.Space();

                                    EditorGUILayout.PropertyField(m_PVRFilterTypeIndirect, Styles.PVRFilterTypeIndirect);
                                    DrawFilterSettingField(m_PVRFilteringGaussRadiusIndirect,
                                                           m_PVRFilteringAtrousPositionSigmaIndirect,
                                                           Styles.PVRFilteringGaussRadiusIndirect,
                                                           Styles.PVRFilteringAtrousPositionSigmaIndirect,
                                                           LightmapEditorSettings.filterTypeIndirect);

                                    using (new EditorGUI.DisabledScope(!m_AmbientOcclusion.boolValue))
                                    {
                                        EditorGUILayout.Space();

                                        EditorGUILayout.PropertyField(m_PVRFilterTypeAO, Styles.PVRFilterTypeAO);
                                        DrawFilterSettingField(m_PVRFilteringGaussRadiusAO,
                                                               m_PVRFilteringAtrousPositionSigmaAO,
                                                               Styles.PVRFilteringGaussRadiusAO, Styles.PVRFilteringAtrousPositionSigmaAO,
                                                               LightmapEditorSettings.filterTypeAO);
                                    }

                                    EditorGUI.indentLevel--;
                                }

                                EditorGUI.indentLevel--;
                                EditorGUILayout.Space();
                            }
                        }
                    }

                    using (new EditorGUI.DisabledScope((LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.ProgressiveCPU) && !m_EnableRealtimeGI.boolValue))
                    {
                        DrawResolutionField(m_Resolution, Styles.IndirectResolution);
                    }

                    if (bakedGISupported)
                    {
                        using (new EditorGUI.DisabledScope(!m_EnabledBakedGI.boolValue))
                        {
                            DrawResolutionField(m_BakeResolution, Styles.LightmapResolution);

                            GUILayout.BeginHorizontal();
                            EditorGUILayout.PropertyField(m_Padding, Styles.Padding);
                            GUILayout.Label(" texels", Styles.LabelStyle);
                            GUILayout.EndHorizontal();

                            EditorGUILayout.IntPopup(m_LightmapSize, Styles.LightmapSizeStrings, Styles.LightmapSizeValues, Styles.LightmapSize);

                            EditorGUILayout.PropertyField(m_TextureCompression, Styles.TextureCompression);

                            EditorGUILayout.PropertyField(m_AmbientOcclusion, Styles.AmbientOcclusion);
                            if (m_AmbientOcclusion.boolValue)
                            {
                                EditorGUI.indentLevel++;
                                EditorGUILayout.PropertyField(m_AOMaxDistance, Styles.AOMaxDistance);
                                if (m_AOMaxDistance.floatValue < 0.0f)
                                {
                                    m_AOMaxDistance.floatValue = 0.0f;
                                }
                                EditorGUILayout.Slider(m_CompAOExponent, 0.0f, 10.0f, Styles.AmbientOcclusionContribution);
                                EditorGUILayout.Slider(m_CompAOExponentDirect, 0.0f, 10.0f, Styles.AmbientOcclusionContributionDirect);
                                EditorGUI.indentLevel--;
                            }

                            if (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.Enlighten)
                            {
                                EditorGUILayout.PropertyField(m_FinalGather, Styles.FinalGather);
                                if (m_FinalGather.boolValue)
                                {
                                    EditorGUI.indentLevel++;
                                    EditorGUILayout.PropertyField(m_FinalGatherRayCount, Styles.FinalGatherRayCount);
                                    EditorGUILayout.PropertyField(m_FinalGatherFiltering, Styles.FinalGatherFiltering);
                                    EditorGUI.indentLevel--;
                                }
                            }
                        }
                    }

                    bool directionalSupported = SupportedRenderingFeatures.IsLightmapsModeSupported(LightmapsMode.CombinedDirectional);

                    if (directionalSupported || (m_LightmapDirectionalMode.intValue == (int)LightmapsMode.CombinedDirectional))
                    {
                        EditorGUILayout.IntPopup(m_LightmapDirectionalMode, Styles.LightmapDirectionalModeStrings, Styles.LightmapDirectionalModeValues, Styles.LightmapDirectionalMode);

                        if (!directionalSupported)
                        {
                            EditorGUILayout.HelpBox(Styles.DirectionalNotSupportedWarning.text, MessageType.Warning);
                        }
                    }
                    else
                    {
                        using (new EditorGUI.DisabledScope(true))
                        {
                            EditorGUILayout.IntPopup(Styles.LightmapDirectionalMode, 0, Styles.LightmapDirectionalModeStrings, Styles.LightmapDirectionalModeValues);
                        }
                    }

                    EditorGUILayout.Slider(m_IndirectOutputScale, 0.0f, 5.0f, Styles.IndirectOutputScale);

                    // albedo boost, push the albedo value towards one in order to get more bounce
                    EditorGUILayout.Slider(m_AlbedoBoost, 1.0f, 10.0f, Styles.AlbedoBoost);

                    if (LightmapParametersGUI(m_LightmapParameters, Styles.DefaultLightmapParameters))
                    {
                        EditorWindow.FocusWindowIfItsOpen <InspectorWindow>();
                    }

                    EditorGUI.indentLevel--;
                    EditorGUILayout.Space();
                }
            }
        }
示例#29
0
 private void DeveloperBuildEnlightenSettings(SerializedObject so)
 {
     if (Unsupported.IsDeveloperBuild())
     {
         this.m_ShowDevOptions = EditorGUILayout.Foldout(this.m_ShowDevOptions, "Debug [internal]");
         if (this.m_ShowDevOptions)
         {
             SerializedProperty property  = so.FindProperty("m_GISettings.m_BounceScale");
             SerializedProperty property2 = so.FindProperty("m_GISettings.m_TemporalCoherenceThreshold");
             EditorGUI.indentLevel++;
             Lightmapping.concurrentJobsType        = (Lightmapping.ConcurrentJobsType)EditorGUILayout.IntPopup(styles.ConcurrentJobs, (int)Lightmapping.concurrentJobsType, this.kConcurrentJobsTypeStrings, this.kConcurrentJobsTypeValues, new GUILayoutOption[0]);
             Lightmapping.enlightenForceUpdates     = EditorGUILayout.Toggle(styles.ForceUpdates, Lightmapping.enlightenForceUpdates, new GUILayoutOption[0]);
             Lightmapping.enlightenForceWhiteAlbedo = EditorGUILayout.Toggle(styles.ForceWhiteAlbedo, Lightmapping.enlightenForceWhiteAlbedo, new GUILayoutOption[0]);
             Lightmapping.filterMode = (FilterMode)EditorGUILayout.EnumPopup(EditorGUIUtility.TempContent("Filter Mode"), Lightmapping.filterMode, new GUILayoutOption[0]);
             EditorGUILayout.Slider(property, 0f, 10f, styles.BounceScale, new GUILayoutOption[0]);
             EditorGUILayout.Slider(property2, 0f, 1f, styles.UpdateThreshold, new GUILayoutOption[0]);
             GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) };
             if (GUILayout.Button("Clear disk cache", options))
             {
                 Lightmapping.Clear();
                 Lightmapping.ClearDiskCache();
             }
             GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) };
             if (GUILayout.Button("Print state to console", optionArray2))
             {
                 Lightmapping.PrintStateToConsole();
             }
             GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) };
             if (GUILayout.Button("Reset albedo/emissive", optionArray3))
             {
                 GIDebugVisualisation.ResetRuntimeInputTextures();
             }
             GUILayoutOption[] optionArray4 = new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) };
             if (GUILayout.Button("Reset environment", optionArray4))
             {
                 DynamicGI.UpdateEnvironment();
             }
             EditorGUI.indentLevel--;
         }
     }
 }
        void DisplayUpdateGUI()
        {
            EditorGUILayout.IntPopup(m_UpdateMode, styles.updateModeStrings, styles.updateModeValues, styles.updateMode);

            EditorGUI.indentLevel++;

            if (m_UpdateMode.intValue == (int)CustomRenderTextureUpdateMode.Realtime)
            {
                EditorGUILayout.PropertyField(m_UpdatePeriod, styles.updatePeriod);
            }

            EditorGUILayout.PropertyField(m_DoubleBuffered, styles.doubleBuffered);
            EditorGUILayout.PropertyField(m_WrapUpdateZones, styles.wrapUpdateZones);

            bool isCubemap = true;

            foreach (Object o in targets)
            {
                CustomRenderTexture customRenderTexture = o as CustomRenderTexture;
                if (customRenderTexture != null && customRenderTexture.dimension != UnityEngine.Rendering.TextureDimension.Cube)
                {
                    isCubemap = false;
                }
            }

            if (isCubemap)
            {
                int newFaceMask     = 0;
                int currentFaceMask = m_CubeFaceMask.intValue;

                var AllRects = GUILayoutUtility.GetRect(0, EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing * 2);
                EditorGUI.BeginProperty(AllRects, GUIContent.none, m_CubeFaceMask);

                Rect toggleRect = AllRects;
                toggleRect.width  = kToggleWidth;
                toggleRect.height = EditorGUIUtility.singleLineHeight;
                int faceIndex = 0;
                {
                    Rect labelRect = AllRects;
                    EditorGUI.LabelField(labelRect, styles.cubemapFacesLabel);

                    EditorGUI.BeginChangeCheck();
                    for (int i = 0; i < 3; ++i)
                    {
                        toggleRect.x = AllRects.x + EditorGUIUtility.labelWidth - kIndentSize;

                        {
                            for (int j = 0; j < 2; ++j)
                            {
                                bool value = EditorGUI.ToggleLeft(toggleRect, styles.cubemapFaces[faceIndex], (currentFaceMask & (1 << faceIndex)) != 0);
                                if (value)
                                {
                                    newFaceMask |= (int)(1 << faceIndex);
                                }
                                faceIndex++;

                                toggleRect.x += kToggleWidth;
                            }
                        }

                        toggleRect.y += EditorGUIUtility.singleLineHeight;
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        m_CubeFaceMask.intValue = newFaceMask;
                    }
                }
                EditorGUI.EndProperty();
            }


            EditorGUILayout.IntPopup(m_UpdateZoneSpace, styles.updateZoneSpaceStrings, styles.updateZoneSpaceValues, styles.updateZoneSpace);

            if (!multipleEditing)
            {
                Rect listRect = GUILayoutUtility.GetRect(0.0f, m_RectList.GetHeight() + kRListAddButtonOffset, GUILayout.ExpandWidth(true)); // kRListAddButtonOffset because reorderable list does not take the  +/- button at the bottom when computing its Rects making it half occulted by other GUI elements.
                // Reorderable list seems to not take indentLevel into account properly.
                float indentSize = kIndentSize;
                listRect.x     += indentSize;
                listRect.width -= indentSize;
                m_RectList.DoList(listRect);
            }
            else
            {
                EditorGUILayout.HelpBox("Update Zones cannot be changed while editing multiple Custom Textures.", MessageType.Info);
            }

            EditorGUI.indentLevel--;
        }