internal void OnTierGUI(BuildTargetGroup platform, GraphicsTier tier, bool vertical) { TierSettings ts = EditorGraphicsSettings.GetTierSettings(platform, tier); EditorGUI.BeginChangeCheck(); if (!vertical) { EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); } bool usingSRP = GraphicsSettings.renderPipelineAsset != null; if (!usingSRP) { ts.standardShaderQuality = ShaderQualityPopup(ts.standardShaderQuality); ts.reflectionProbeBoxProjection = EditorGUILayout.Toggle(ts.reflectionProbeBoxProjection); ts.reflectionProbeBlending = EditorGUILayout.Toggle(ts.reflectionProbeBlending); ts.detailNormalMap = EditorGUILayout.Toggle(ts.detailNormalMap); ts.semitransparentShadows = EditorGUILayout.Toggle(ts.semitransparentShadows); } if (SupportedRenderingFeatures.active.rendererSupportsLightProbeProxyVolumes) { ts.enableLPPV = EditorGUILayout.Toggle(ts.enableLPPV); } if (!vertical) { EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); } if (!usingSRP) { ts.cascadedShadowMaps = EditorGUILayout.Toggle(ts.cascadedShadowMaps); ts.prefer32BitShadowMaps = EditorGUILayout.Toggle(ts.prefer32BitShadowMaps); ts.hdr = EditorGUILayout.Toggle(ts.hdr); } ts.hdrMode = HDRModePopup(ts.hdrMode); if (!usingSRP) { ts.renderingPath = RenderingPathPopup(ts.renderingPath); } if (SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime)) { ts.realtimeGICPUUsage = RealtimeGICPUUsagePopup(ts.realtimeGICPUUsage); } if (EditorGUI.EndChangeCheck()) { // TODO: it should be doable in c# now as we "expose" GraphicsSettings anyway EditorGraphicsSettings.RegisterUndo(); EditorGraphicsSettings.SetTierSettings(platform, tier, ts); } }
public override UnityEditor.SupportedRenderingFeatures GetSupportedRenderingFeatures() { var features = new UnityEditor.SupportedRenderingFeatures { reflectionProbe = UnityEditor.SupportedRenderingFeatures.ReflectionProbe.Rotation }; return(features); }
void SetupModes() { if (m_Modes == null) { m_Modes = new List <Mode>(); } bool isRealtimeSupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime); bool isBakedSupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked); bool isEnvironmentSupported = !(SupportedRenderingFeatures.active.overridesEnvironmentLighting && SupportedRenderingFeatures.active.overridesFog && SupportedRenderingFeatures.active.overridesOtherLightingSettings); if (m_IsRealtimeSupported != isRealtimeSupported || m_IsBakedSupported != isBakedSupported || m_IsEnvironmentSupported != isEnvironmentSupported) { m_Modes.Clear(); m_IsBakedSupported = isBakedSupported; m_IsRealtimeSupported = isRealtimeSupported; m_IsEnvironmentSupported = isEnvironmentSupported; } // if nothing has changed since last time and we have data, we return if (m_Modes.Count > 0) { return; } List <GUIContent> modeStringList = new List <GUIContent>(); m_Modes.Add(Mode.LightingSettings); modeStringList.Add(Styles.modeStrings[(int)Mode.LightingSettings]); if (m_IsEnvironmentSupported) { m_Modes.Add(Mode.EnvironmentSettings); modeStringList.Add(Styles.modeStrings[(int)Mode.EnvironmentSettings]); } if (m_IsRealtimeSupported) { m_Modes.Add(Mode.RealtimeLightmaps); modeStringList.Add(Styles.modeStrings[(int)Mode.RealtimeLightmaps]); } if (m_IsBakedSupported) { m_Modes.Add(Mode.BakedLightmaps); modeStringList.Add(Styles.modeStrings[(int)Mode.BakedLightmaps]); } Debug.Assert(m_Modes.Count == modeStringList.Count); m_ModeStrings = modeStringList.ToArray(); }
void MixedLightingGUI() { if (!SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked)) { return; } m_ShowMixedLightsSettings = EditorGUILayout.FoldoutTitlebar(m_ShowMixedLightsSettings, Styles.MixedLightsLabel, true); if (m_ShowMixedLightsSettings) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_EnabledBakedGI, Styles.EnableBaked); if (!m_EnabledBakedGI.boolValue) { EditorGUILayout.HelpBox(Styles.BakedGIDisabledInfo.text, MessageType.Info); } using (new EditorGUI.DisabledScope(!m_EnabledBakedGI.boolValue)) { bool mixedGISupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Mixed); if (mixedGISupported) { EditorGUILayout.IntPopup(m_MixedBakeMode, Styles.MixedModeStrings, Styles.MixedModeValues, Styles.MixedLightMode); if (!SupportedRenderingFeatures.IsMixedLightingModeSupported((MixedLightingMode)m_MixedBakeMode.intValue)) { string fallbackMode = Styles.MixedModeStrings[(int)SupportedRenderingFeatures.FallbackMixedLightingMode()].text; EditorGUILayout.HelpBox("The Mixed Mode is not supported by the current render pipline. Fallback mode is " + fallbackMode, MessageType.Warning); } else if (m_EnabledBakedGI.boolValue) { EditorGUILayout.HelpBox(Styles.HelpStringsMixed[m_MixedBakeMode.intValue].text, MessageType.Info); } if (m_MixedBakeMode.intValue == (int)MixedLightingMode.Subtractive) { EditorGUILayout.PropertyField(m_SubtractiveShadowColor, Styles.SubtractiveShadowColor); m_RenderSettingsSO.ApplyModifiedProperties(); EditorGUILayout.Space(); } } } EditorGUI.indentLevel--; EditorGUILayout.Space(); } }
internal void OnFieldLabelsGUI(bool vertical) { if (!vertical) { EditorGUILayout.LabelField(Styles.standardShaderSettings, EditorStyles.boldLabel); } bool usingSRP = GraphicsSettings.renderPipelineAsset != null; if (!usingSRP) { EditorGUILayout.LabelField(Styles.standardShaderQuality); EditorGUILayout.LabelField(Styles.reflectionProbeBoxProjection); EditorGUILayout.LabelField(Styles.reflectionProbeBlending); EditorGUILayout.LabelField(Styles.detailNormalMap); EditorGUILayout.LabelField(Styles.semitransparentShadows); } if (SupportedRenderingFeatures.active.rendererSupportsLightProbeProxyVolumes) { EditorGUILayout.LabelField(Styles.enableLPPV); } if (!vertical) { EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); EditorGUILayout.LabelField(Styles.renderingSettings, EditorStyles.boldLabel); } if (!usingSRP) { EditorGUILayout.LabelField(Styles.cascadedShadowMaps); EditorGUILayout.LabelField(Styles.prefer32BitShadowMaps); EditorGUILayout.LabelField(Styles.useHDR); } EditorGUILayout.LabelField(Styles.hdrMode); if (!usingSRP) { EditorGUILayout.LabelField(Styles.renderingPath); } if (SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime)) { EditorGUILayout.LabelField(Styles.realtimeGICPUUsage); } }
public void DrawLightmapping() { var rect = EditorGUILayout.GetControlRect(); EditorGUI.BeginProperty(rect, s_Styles.LightmappingMode, lightmapping); rect = EditorGUI.PrefixLabel(rect, s_Styles.LightmappingMode); int index = Math.Max(0, Array.IndexOf(s_Styles.LightmapBakeTypeValues, lightmapping.intValue)); if (EditorGUI.DropdownButton(rect, s_Styles.LightmapBakeTypeTitles[index], FocusType.Passive)) { var menu = new GenericMenu(); for (int i = 0; i < s_Styles.LightmapBakeTypeValues.Length; i++) { int value = s_Styles.LightmapBakeTypeValues[i]; bool selected = (lightmappingTypeIsSame && (value == lightmapping.intValue)); if (((value == (int)LightmapBakeType.Mixed) || (value == (int)LightmapBakeType.Baked)) && ((!SupportedRenderingFeatures.IsLightmapBakeTypeSupported((LightmapBakeType)value) || !Lightmapping.bakedGI) && !isPrefabAsset)) { menu.AddDisabledItem(s_Styles.LightmapBakeTypeTitles[i], selected); } else { menu.AddItem(s_Styles.LightmapBakeTypeTitles[i], selected, OnLightmappingItemSelected, value); } } menu.DropDown(rect); } EditorGUI.EndProperty(); // first make sure that the modes arent unsupported, then unenabled if (showMixedModeUnsupportedWarning) { EditorGUILayout.HelpBox(s_Styles.MixedUnsupportedWarning.text, MessageType.Warning); } else if (showBakedModeUnsupportedWarning) { EditorGUILayout.HelpBox(s_Styles.BakedUnsupportedWarning.text, MessageType.Warning); } else if (showBakingWarning) { EditorGUILayout.HelpBox(s_Styles.BakingWarning.text, MessageType.Warning); } }
private void RealtimeLightingGUI() { if (SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime)) { this.m_ShowRealtimeLightsSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowRealtimeLightsSettings, LightingWindowBakeSettings.Styles.RealtimeLightsLabel, true); if (this.m_ShowRealtimeLightsSettings) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_EnableRealtimeGI, LightingWindowBakeSettings.Styles.UseRealtimeGI, new GUILayoutOption[0]); if (this.m_EnableRealtimeGI.boolValue && LightingWindowBakeSettings.PlayerHasSM20Support()) { EditorGUILayout.HelpBox(LightingWindowBakeSettings.Styles.NoRealtimeGIInSM2AndGLES2.text, MessageType.Warning); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } } }
private void MixedLightingGUI() { if (SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked)) { this.m_ShowMixedLightsSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowMixedLightsSettings, LightingWindowBakeSettings.Styles.MixedLightsLabel, true); if (this.m_ShowMixedLightsSettings) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_EnabledBakedGI, LightingWindowBakeSettings.Styles.EnableBaked, new GUILayoutOption[0]); if (!this.m_EnabledBakedGI.boolValue) { EditorGUILayout.HelpBox(LightingWindowBakeSettings.Styles.BakedGIDisabledInfo.text, MessageType.Info); } using (new EditorGUI.DisabledScope(!this.m_EnabledBakedGI.boolValue)) { bool flag = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Mixed); if (flag) { EditorGUILayout.IntPopup(this.m_MixedBakeMode, LightingWindowBakeSettings.Styles.MixedModeStrings, LightingWindowBakeSettings.Styles.MixedModeValues, LightingWindowBakeSettings.Styles.MixedLightMode, new GUILayoutOption[0]); if (!SupportedRenderingFeatures.IsMixedLightingModeSupported((MixedLightingMode)this.m_MixedBakeMode.intValue)) { string text = LightingWindowBakeSettings.Styles.MixedModeStrings[(int)SupportedRenderingFeatures.FallbackMixedLightingMode()].text; EditorGUILayout.HelpBox("The Mixed Mode is not supported by the current render pipline. Fallback mode is " + text, MessageType.Warning); } else if (this.m_EnabledBakedGI.boolValue) { EditorGUILayout.HelpBox(LightingWindowBakeSettings.Styles.HelpStringsMixed[this.m_MixedBakeMode.intValue].text, MessageType.Info); } if (this.m_MixedBakeMode.intValue == 1) { EditorGUILayout.PropertyField(this.m_SubtractiveShadowColor, LightingWindowBakeSettings.Styles.SubtractiveShadowColor, new GUILayoutOption[0]); this.m_RenderSettingsSO.ApplyModifiedProperties(); EditorGUILayout.Space(); } } } EditorGUI.indentLevel--; EditorGUILayout.Space(); } } }
void RealtimeLightingGUI() { if (!SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime)) { return; } m_ShowRealtimeLightsSettings = EditorGUILayout.FoldoutTitlebar(m_ShowRealtimeLightsSettings, Styles.RealtimeLightsLabel, true); if (m_ShowRealtimeLightsSettings) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_EnableRealtimeGI, Styles.UseRealtimeGI); if (m_EnableRealtimeGI.boolValue && PlayerHasSM20Support()) { EditorGUILayout.HelpBox(Styles.NoRealtimeGIInSM2AndGLES2.text, MessageType.Warning); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } }
protected virtual LightingExplorerTableColumn[] GetLightColumns() { return(new[] { new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Checkbox, Styles.Enabled, "m_Enabled", 50), // 0: Enabled new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Name, Styles.Name, null, 200), // 1: Name new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Enum, Styles.Type, "m_Type", 120, (r, prop, dep) => { // To the user, we will only display it as a area light, but under the hood, we have Rectangle and Disc. This is not to confuse people // who still use our legacy light inspector. int selectedLightType = prop.intValue; if (!Styles.LightTypeValues.Contains(prop.intValue)) { if (prop.intValue == (int)LightType.Disc) { selectedLightType = (int)LightType.Rectangle; } else { Debug.LogError("Light type is not supported by the Light Explorer."); } } EditorGUI.BeginProperty(r, GUIContent.none, prop); EditorGUI.BeginChangeCheck(); int type = EditorGUI.IntPopup(r, selectedLightType, Styles.LightTypeTitles, Styles.LightTypeValues); if (EditorGUI.EndChangeCheck()) { prop.intValue = type; } EditorGUI.EndProperty(); }), // 2: Type new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Enum, Styles.Shape, "m_Type", 120, (r, prop, dep) => { // This is only appliable to the Area lights that have a shape. For the other lights, nothing will be shown if (Styles.LightShapeValues.Contains(prop.intValue)) { EditorGUI.BeginProperty(r, GUIContent.none, prop); EditorGUI.BeginChangeCheck(); int type = EditorGUI.IntPopup(r, prop.intValue, Styles.LightShapeTitles, Styles.LightShapeValues); if (EditorGUI.EndChangeCheck()) { prop.intValue = type; } EditorGUI.EndProperty(); } }), // 3: Shape new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Enum, Styles.Mode, "m_Lightmapping", 70, (r, prop, dep) => { bool areaLight = dep.Length > 1 && (dep[0].enumValueIndex == (int)LightType.Rectangle || dep[0].enumValueIndex == (int)LightType.Disc); using (new EditorGUI.DisabledScope(areaLight)) { EditorGUI.BeginProperty(r, GUIContent.none, prop); EditorGUI.BeginChangeCheck(); int newval = EditorGUI.IntPopup(r, prop.intValue, Styles.LightmapBakeTypeTitles, Styles.LightmapBakeTypeValues); if (EditorGUI.EndChangeCheck()) { prop.intValue = newval; } EditorGUI.EndProperty(); } }, null, null, new int[] { 2 }), // 4: Mode new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Color, Styles.Color, "m_Color", 70), // 5: Color new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Float, Styles.Intensity, "m_Intensity", 60), // 6: Intensity new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Float, Styles.IndirectMultiplier, "m_BounceIntensity", 110, (r, prop, dep) => { bool realtimeLight = dep.Length > 1 && dep[0].intValue == (int)LightmapBakeType.Realtime; if (!(realtimeLight && !SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime))) { EditorGUI.PropertyField(r, prop, GUIContent.none); } }, null, null, new int[] { 4 }), // 7: Indirect Multiplier new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Enum, Styles.ShadowType, "m_Shadows.m_Type", 100, (r, prop, dep) => { bool areaLight = dep.Length > 1 && (dep[0].enumValueIndex == (int)LightType.Rectangle || dep[0].enumValueIndex == (int)LightType.Disc); if (areaLight) { EditorGUI.BeginProperty(r, GUIContent.none, prop); EditorGUI.BeginChangeCheck(); bool shadows = EditorGUI.Toggle(r, prop.intValue != (int)LightShadows.None); if (EditorGUI.EndChangeCheck()) { prop.intValue = shadows ? (int)LightShadows.Soft : (int)LightShadows.None; } EditorGUI.EndProperty(); } else { EditorGUI.PropertyField(r, prop, GUIContent.none); } }, null, null, new int[] { 2 }), // 8: Shadow Type }); }
private void DrawGUI() { Material skyboxMaterial = m_SkyboxMaterial.objectReferenceValue as Material; m_bShowEnvironment = EditorGUILayout.FoldoutTitlebar(m_bShowEnvironment, Styles.env_top, true); if (m_bShowEnvironment) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_SkyboxMaterial, Styles.env_skybox_mat); if (skyboxMaterial && !EditorMaterialUtility.IsBackgroundMaterial(skyboxMaterial)) { EditorGUILayout.HelpBox(Styles.skyboxWarning.text, MessageType.Warning); } EditorGUILayout.PropertyField(m_Sun, Styles.env_skybox_sun); EditorGUILayout.Space(); EditorGUILayout.LabelField(Styles.env_amb_top); EditorGUI.indentLevel++; EditorGUILayout.IntPopup(m_AmbientSource, Styles.kFullAmbientSource, Styles.kFullAmbientSourceValues, Styles.env_amb_src); switch ((AmbientMode)m_AmbientSource.intValue) { case AmbientMode.Trilight: { EditorGUI.BeginChangeCheck(); Color newValueUp = EditorGUILayout.ColorField(Styles.ambientUp, m_AmbientSkyColor.colorValue, true, false, true); Color newValueMid = EditorGUILayout.ColorField(Styles.ambientMid, m_AmbientEquatorColor.colorValue, true, false, true); Color newValueDown = EditorGUILayout.ColorField(Styles.ambientDown, m_AmbientGroundColor.colorValue, true, false, true); if (EditorGUI.EndChangeCheck()) { m_AmbientSkyColor.colorValue = newValueUp; m_AmbientEquatorColor.colorValue = newValueMid; m_AmbientGroundColor.colorValue = newValueDown; } } break; case AmbientMode.Flat: { EditorGUI.BeginChangeCheck(); Color newValue = EditorGUILayout.ColorField(Styles.ambient, m_AmbientSkyColor.colorValue, true, false, true); if (EditorGUI.EndChangeCheck()) { m_AmbientSkyColor.colorValue = newValue; } } break; case AmbientMode.Skybox: if (skyboxMaterial == null) { EditorGUI.BeginChangeCheck(); Color newValue = EditorGUILayout.ColorField(Styles.ambient, m_AmbientSkyColor.colorValue, true, false, true); if (EditorGUI.EndChangeCheck()) { m_AmbientSkyColor.colorValue = newValue; } } else { // Ambient intensity - maximum is kEmissiveRGBMMax EditorGUILayout.Slider(m_AmbientIntensity, 0.0F, 8.0F, Styles.env_amb_int); } break; } // ambient GI - realtime / baked bool realtimeGISupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime); bool bakedGISupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked); if ((m_EnabledBakedGI.boolValue || m_EnabledRealtimeGI.boolValue) && (bakedGISupported || realtimeGISupported)) { int[] modeVals = { 0, 1 }; if (m_EnabledBakedGI.boolValue && m_EnabledRealtimeGI.boolValue) { // if the user has selected the only state that is supported, then gray it out using (new EditorGUI.DisabledScope(((m_AmbientLightingMode.intValue == 0) && realtimeGISupported && !bakedGISupported) || ((m_AmbientLightingMode.intValue == 1) && bakedGISupported && !realtimeGISupported))) { EditorGUILayout.IntPopup(m_AmbientLightingMode, Styles.AmbientLightingModes, modeVals, Styles.AmbientLightingMode); } // if they have selected a state that isnt supported, show dialog, and still make the box editable if (((m_AmbientLightingMode.intValue == 0) && !realtimeGISupported) || ((m_AmbientLightingMode.intValue == 1) && !bakedGISupported)) { EditorGUILayout.HelpBox("The following mode is not supported and will fallback on " + (((m_AmbientLightingMode.intValue == 0) && !realtimeGISupported) ? "Baked" : "Realtime"), MessageType.Warning); } } // Show "Baked" if precomputed GI is disabled and "Realtime" if baked GI is disabled (but we don't wanna show the box if the whole mode is not supported.) else if ((m_EnabledBakedGI.boolValue && bakedGISupported) || (m_EnabledRealtimeGI.boolValue && realtimeGISupported)) { using (new EditorGUI.DisabledScope(true)) { EditorGUILayout.IntPopup(Styles.AmbientLightingMode, m_EnabledBakedGI.boolValue ? 1 : 0, Styles.AmbientLightingModes, modeVals); } } } EditorGUI.indentLevel--; EditorGUILayout.Space(); EditorGUILayout.LabelField(Styles.env_refl_top); EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_DefaultReflectionMode, Styles.env_refl_src); DefaultReflectionMode defReflectionMode = (DefaultReflectionMode)m_DefaultReflectionMode.intValue; switch (defReflectionMode) { case DefaultReflectionMode.FromSkybox: { int[] reflectionResolutionValuesArray = null; GUIContent[] reflectionResolutionTextArray = null; ReflectionProbeEditor.GetResolutionArray(ref reflectionResolutionValuesArray, ref reflectionResolutionTextArray); EditorGUILayout.IntPopup(m_DefaultReflectionResolution, reflectionResolutionTextArray, reflectionResolutionValuesArray, Styles.env_refl_res, GUILayout.MinWidth(40)); } break; case DefaultReflectionMode.Custom: EditorGUILayout.PropertyField(m_CustomReflection, Styles.customReflection); break; } EditorGUILayout.PropertyField(m_ReflectionCompression, Styles.env_refl_cmp); EditorGUILayout.Slider(m_ReflectionIntensity, 0.0F, 1.0F, Styles.env_refl_int); EditorGUILayout.IntSlider(m_ReflectionBounces, 1, 5, Styles.env_refl_bnc); EditorGUI.indentLevel--; EditorGUI.indentLevel--; EditorGUILayout.Space(); } }
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(); 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.ProgressiveCPU) { 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("Directional Mode is not supported. Fallback will be Non-Directional.", 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(); } } }
public override void OnInspectorGUI() { serializedObject.Update(); // realtime settings if (SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime)) { GUILayout.Label(Styles.precomputedRealtimeGIContent, EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_Resolution, Styles.resolutionContent); EditorGUILayout.Slider(m_ClusterResolution, 0.1F, 1.0F, Styles.clusterResolutionContent); EditorGUILayout.IntSlider(m_IrradianceBudget, 32, 2048, Styles.irradianceBudgetContent); EditorGUILayout.IntSlider(m_IrradianceQuality, 512, 131072, Styles.irradianceQualityContent); EditorGUILayout.Slider(m_ModellingTolerance, 0.0f, 1.0f, Styles.modellingToleranceContent); EditorGUILayout.PropertyField(m_EdgeStitching, Styles.edgeStitchingContent); EditorGUILayout.PropertyField(m_IsTransparent, Styles.isTransparent); EditorGUILayout.PropertyField(m_SystemTag, Styles.systemTagContent); EditorGUILayout.Space(); } // baked settings #pragma warning disable 618 bool usesPathTracerBakeBackend = Lightmapping.GetLightingSettingsOrDefaultsFallback().lightmapper != LightingSettings.Lightmapper.Enlighten; bool usesEnlightenBackend = Lightmapping.GetLightingSettingsOrDefaultsFallback().lightmapper == LightingSettings.Lightmapper.Enlighten; bool bakedEnlightenSupported = SupportedRenderingFeatures.IsLightmapperSupported((int)LightingSettings.Lightmapper.Enlighten); #pragma warning restore 618 GUILayout.Label(Styles.bakedGIContent, EditorStyles.boldLabel); if (bakedEnlightenSupported) { using (new EditorGUI.DisabledScope(usesPathTracerBakeBackend)) { EditorGUILayout.PropertyField(m_BlurRadius, Styles.blurRadiusContent); EditorGUILayout.PropertyField(m_DirectLightQuality, Styles.directLightQualityContent); } } EditorGUILayout.PropertyField(m_AntiAliasingSamples, Styles.antiAliasingSamplesContent); const float minPushOff = 0.0001f; // Keep in sync with PLM_MIN_PUSHOFF EditorGUILayout.Slider(m_Pushoff, minPushOff, 1.0f, Styles.pushoffContent); EditorGUILayout.PropertyField(m_BakedLightmapTag, Styles.bakedLightmapTagContent); using (new EditorGUI.DisabledScope(usesEnlightenBackend)) { m_LimitLightmapCount.boolValue = EditorGUILayout.Toggle(Styles.limitLightmapCount, m_LimitLightmapCount.boolValue); if (m_LimitLightmapCount.boolValue) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_LightmapMaxCount, Styles.lightmapMaxCount); EditorGUI.indentLevel--; } } EditorGUILayout.Space(); if (bakedEnlightenSupported) { using (new EditorGUI.DisabledScope(usesPathTracerBakeBackend)) { GUILayout.Label(Styles.bakedAOContent, EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_AOQuality, Styles.aoQualityContent); EditorGUILayout.PropertyField(m_AOAntiAliasingSamples, Styles.aoAntiAliasingSamplesContent); } } GUILayout.Label(Styles.generalGIContent, EditorStyles.boldLabel); EditorGUILayout.Slider(m_BackFaceTolerance, 0.0f, 1.0f, Styles.backFaceToleranceContent); serializedObject.ApplyModifiedProperties(); }
void MixedLightingGUI() { if (!SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked)) { return; } m_ShowMixedLightsSettings = EditorGUILayout.FoldoutTitlebar(m_ShowMixedLightsSettings, Styles.MixedLightsLabel, true); if (m_ShowMixedLightsSettings) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_EnabledBakedGI, Styles.EnableBaked); if (!m_EnabledBakedGI.boolValue) { EditorGUILayout.HelpBox(Styles.BakedGIDisabledInfo.text, MessageType.Info); } using (new EditorGUI.DisabledScope(!m_EnabledBakedGI.boolValue)) { bool mixedGISupported = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Mixed); using (new EditorGUI.DisabledScope(!mixedGISupported)) { var rect = EditorGUILayout.GetControlRect(); EditorGUI.BeginProperty(rect, Styles.MixedLightMode, m_MixedBakeMode); rect = EditorGUI.PrefixLabel(rect, Styles.MixedLightMode); int index = Math.Max(0, Array.IndexOf(Styles.MixedModeValues, m_MixedBakeMode.intValue)); if (EditorGUI.DropdownButton(rect, Styles.MixedModeStrings[index], FocusType.Passive)) { var menu = new GenericMenu(); for (int i = 0; i < Styles.MixedModeValues.Length; i++) { int value = Styles.MixedModeValues[i]; bool selected = (value == m_MixedBakeMode.intValue); if (!SupportedRenderingFeatures.IsMixedLightingModeSupported((MixedLightingMode)value)) { menu.AddDisabledItem(Styles.MixedModeStrings[i], selected); } else { menu.AddItem(Styles.MixedModeStrings[i], selected, OnMixedModeSelected, value); } } menu.DropDown(rect); } EditorGUI.EndProperty(); if (mixedGISupported) { if (!SupportedRenderingFeatures.IsMixedLightingModeSupported((MixedLightingMode)m_MixedBakeMode.intValue)) { string fallbackMode = Styles.MixedModeStrings[(int)SupportedRenderingFeatures.FallbackMixedLightingMode()].text; EditorGUILayout.HelpBox(Styles.MixedModeNotSupportedWarning.text + fallbackMode, MessageType.Warning); } else if (m_EnabledBakedGI.boolValue) { EditorGUILayout.HelpBox(Styles.HelpStringsMixed[m_MixedBakeMode.intValue].text, MessageType.Info); } } if (m_MixedBakeMode.intValue == (int)MixedLightingMode.Subtractive) { EditorGUILayout.PropertyField(m_SubtractiveShadowColor, Styles.SubtractiveShadowColor); m_RenderSettingsSO.ApplyModifiedProperties(); EditorGUILayout.Space(); } } } EditorGUI.indentLevel--; EditorGUILayout.Space(); } }
private void DrawGUI() { Material material = this.m_SkyboxMaterial.objectReferenceValue as Material; this.m_bShowEnvironment = EditorGUILayout.FoldoutTitlebar(this.m_bShowEnvironment, LightingEditor.Styles.env_top, true); if (this.m_bShowEnvironment) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_SkyboxMaterial, LightingEditor.Styles.env_skybox_mat, new GUILayoutOption[0]); if (material && !EditorMaterialUtility.IsBackgroundMaterial(material)) { EditorGUILayout.HelpBox(LightingEditor.Styles.skyboxWarning.text, MessageType.Warning); } EditorGUILayout.PropertyField(this.m_Sun, LightingEditor.Styles.env_skybox_sun, new GUILayoutOption[0]); EditorGUILayout.Space(); EditorGUILayout.LabelField(LightingEditor.Styles.env_amb_top, new GUILayoutOption[0]); EditorGUI.indentLevel++; EditorGUILayout.IntPopup(this.m_AmbientSource, LightingEditor.Styles.kFullAmbientSource, LightingEditor.Styles.kFullAmbientSourceValues, LightingEditor.Styles.env_amb_src, new GUILayoutOption[0]); AmbientMode intValue = (AmbientMode)this.m_AmbientSource.intValue; if (intValue != AmbientMode.Trilight) { if (intValue != AmbientMode.Flat) { if (intValue == AmbientMode.Skybox) { if (material == null) { EditorGUI.BeginChangeCheck(); Color colorValue = EditorGUILayout.ColorField(LightingEditor.Styles.ambient, this.m_AmbientSkyColor.colorValue, true, false, true, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { this.m_AmbientSkyColor.colorValue = colorValue; } } else { EditorGUILayout.Slider(this.m_AmbientIntensity, 0f, 8f, LightingEditor.Styles.env_amb_int, new GUILayoutOption[0]); } } } else { EditorGUI.BeginChangeCheck(); Color colorValue2 = EditorGUILayout.ColorField(LightingEditor.Styles.ambient, this.m_AmbientSkyColor.colorValue, true, false, true, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { this.m_AmbientSkyColor.colorValue = colorValue2; } } } else { EditorGUI.BeginChangeCheck(); Color colorValue3 = EditorGUILayout.ColorField(LightingEditor.Styles.ambientUp, this.m_AmbientSkyColor.colorValue, true, false, true, new GUILayoutOption[0]); Color colorValue4 = EditorGUILayout.ColorField(LightingEditor.Styles.ambientMid, this.m_AmbientEquatorColor.colorValue, true, false, true, new GUILayoutOption[0]); Color colorValue5 = EditorGUILayout.ColorField(LightingEditor.Styles.ambientDown, this.m_AmbientGroundColor.colorValue, true, false, true, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { this.m_AmbientSkyColor.colorValue = colorValue3; this.m_AmbientEquatorColor.colorValue = colorValue4; this.m_AmbientGroundColor.colorValue = colorValue5; } } bool flag = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime); bool flag2 = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked); if ((this.m_EnabledBakedGI.boolValue || this.m_EnabledRealtimeGI.boolValue) && (flag2 || flag)) { int[] optionValues = new int[] { 0, 1 }; if (this.m_EnabledBakedGI.boolValue && this.m_EnabledRealtimeGI.boolValue) { using (new EditorGUI.DisabledScope((this.m_AmbientLightingMode.intValue == 0 && flag && !flag2) || (this.m_AmbientLightingMode.intValue == 1 && flag2 && !flag))) { EditorGUILayout.IntPopup(this.m_AmbientLightingMode, LightingEditor.Styles.AmbientLightingModes, optionValues, LightingEditor.Styles.AmbientLightingMode, new GUILayoutOption[0]); } if ((this.m_AmbientLightingMode.intValue == 0 && !flag) || (this.m_AmbientLightingMode.intValue == 1 && !flag2)) { EditorGUILayout.HelpBox("The following mode is not supported and will fallback on " + ((this.m_AmbientLightingMode.intValue != 0 || flag) ? "Realtime" : "Baked"), MessageType.Warning); } } else if ((this.m_EnabledBakedGI.boolValue && flag2) || (this.m_EnabledRealtimeGI.boolValue && flag)) { using (new EditorGUI.DisabledScope(true)) { EditorGUILayout.IntPopup(LightingEditor.Styles.AmbientLightingMode, (!this.m_EnabledBakedGI.boolValue) ? 0 : 1, LightingEditor.Styles.AmbientLightingModes, optionValues, new GUILayoutOption[0]); } } } EditorGUI.indentLevel--; EditorGUILayout.Space(); EditorGUILayout.LabelField(LightingEditor.Styles.env_refl_top, new GUILayoutOption[0]); EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_DefaultReflectionMode, LightingEditor.Styles.env_refl_src, new GUILayoutOption[0]); DefaultReflectionMode intValue2 = (DefaultReflectionMode)this.m_DefaultReflectionMode.intValue; if (intValue2 != DefaultReflectionMode.FromSkybox) { if (intValue2 == DefaultReflectionMode.Custom) { EditorGUILayout.PropertyField(this.m_CustomReflection, LightingEditor.Styles.customReflection, new GUILayoutOption[0]); } } else { int[] optionValues2 = null; GUIContent[] displayedOptions = null; ReflectionProbeEditor.GetResolutionArray(ref optionValues2, ref displayedOptions); EditorGUILayout.IntPopup(this.m_DefaultReflectionResolution, displayedOptions, optionValues2, LightingEditor.Styles.env_refl_res, new GUILayoutOption[] { GUILayout.MinWidth(40f) }); } EditorGUILayout.PropertyField(this.m_ReflectionCompression, LightingEditor.Styles.env_refl_cmp, new GUILayoutOption[0]); EditorGUILayout.Slider(this.m_ReflectionIntensity, 0f, 1f, LightingEditor.Styles.env_refl_int, new GUILayoutOption[0]); EditorGUILayout.IntSlider(this.m_ReflectionBounces, 1, 5, LightingEditor.Styles.env_refl_bnc, new GUILayoutOption[0]); EditorGUI.indentLevel--; EditorGUI.indentLevel--; EditorGUILayout.Space(); } }
private void GeneralLightmapSettingsGUI() { bool flag = SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Baked); if (flag || SupportedRenderingFeatures.IsLightmapBakeTypeSupported(LightmapBakeType.Realtime)) { this.m_ShowGeneralLightmapSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowGeneralLightmapSettings, LightingWindowBakeSettings.Styles.GeneralLightmapLabel, true); if (this.m_ShowGeneralLightmapSettings) { EditorGUI.indentLevel++; using (new EditorGUI.DisabledScope(!this.m_EnabledBakedGI.boolValue && !this.m_EnableRealtimeGI.boolValue)) { if (flag) { using (new EditorGUI.DisabledScope(!this.m_EnabledBakedGI.boolValue)) { EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(this.m_BakeBackend, LightingWindowBakeSettings.Styles.BakeBackend, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { InspectorWindow.RepaintAllInspectors(); } if (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.PathTracer) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_PVRCulling, LightingWindowBakeSettings.Styles.PVRCulling, new GUILayoutOption[0]); if (LightmapEditorSettings.sampling != LightmapEditorSettings.Sampling.Auto) { EditorGUILayout.PropertyField(this.m_PVRDirectSampleCount, LightingWindowBakeSettings.Styles.PVRDirectSampleCount, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_PVRSampleCount, LightingWindowBakeSettings.Styles.PVRIndirectSampleCount, new GUILayoutOption[0]); if (this.m_PVRSampleCount.intValue < 10 || this.m_PVRSampleCount.intValue > 100000) { this.m_PVRSampleCount.intValue = Math.Max(Math.Min(this.m_PVRSampleCount.intValue, 100000), 10); } } EditorGUILayout.IntPopup(this.m_PVRBounces, LightingWindowBakeSettings.Styles.BouncesStrings, LightingWindowBakeSettings.Styles.BouncesValues, LightingWindowBakeSettings.Styles.PVRBounces, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_PVRFilteringMode, LightingWindowBakeSettings.Styles.PVRFilteringMode, new GUILayoutOption[0]); if (this.m_PVRFilteringMode.enumValueIndex == 2) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_PVRFilterTypeDirect, LightingWindowBakeSettings.Styles.PVRFilterTypeDirect, new GUILayoutOption[0]); LightingWindowBakeSettings.DrawFilterSettingField(this.m_PVRFilteringGaussRadiusDirect, this.m_PVRFilteringAtrousPositionSigmaDirect, LightingWindowBakeSettings.Styles.PVRFilteringGaussRadiusDirect, LightingWindowBakeSettings.Styles.PVRFilteringAtrousPositionSigmaDirect, LightmapEditorSettings.filterTypeDirect); EditorGUILayout.Space(); EditorGUILayout.PropertyField(this.m_PVRFilterTypeIndirect, LightingWindowBakeSettings.Styles.PVRFilterTypeIndirect, new GUILayoutOption[0]); LightingWindowBakeSettings.DrawFilterSettingField(this.m_PVRFilteringGaussRadiusIndirect, this.m_PVRFilteringAtrousPositionSigmaIndirect, LightingWindowBakeSettings.Styles.PVRFilteringGaussRadiusIndirect, LightingWindowBakeSettings.Styles.PVRFilteringAtrousPositionSigmaIndirect, LightmapEditorSettings.filterTypeIndirect); using (new EditorGUI.DisabledScope(!this.m_AmbientOcclusion.boolValue)) { EditorGUILayout.Space(); EditorGUILayout.PropertyField(this.m_PVRFilterTypeAO, LightingWindowBakeSettings.Styles.PVRFilterTypeAO, new GUILayoutOption[0]); LightingWindowBakeSettings.DrawFilterSettingField(this.m_PVRFilteringGaussRadiusAO, this.m_PVRFilteringAtrousPositionSigmaAO, LightingWindowBakeSettings.Styles.PVRFilteringGaussRadiusAO, LightingWindowBakeSettings.Styles.PVRFilteringAtrousPositionSigmaAO, LightmapEditorSettings.filterTypeAO); } EditorGUI.indentLevel--; } EditorGUI.indentLevel--; EditorGUILayout.Space(); } } } using (new EditorGUI.DisabledScope(LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.PathTracer && !this.m_EnableRealtimeGI.boolValue)) { LightingWindowBakeSettings.DrawResolutionField(this.m_Resolution, LightingWindowBakeSettings.Styles.IndirectResolution); } if (flag) { using (new EditorGUI.DisabledScope(!this.m_EnabledBakedGI.boolValue)) { LightingWindowBakeSettings.DrawResolutionField(this.m_BakeResolution, LightingWindowBakeSettings.Styles.LightmapResolution); GUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_Padding, LightingWindowBakeSettings.Styles.Padding, new GUILayoutOption[0]); GUILayout.Label(" texels", LightingWindowBakeSettings.Styles.LabelStyle, new GUILayoutOption[0]); GUILayout.EndHorizontal(); EditorGUILayout.IntPopup(this.m_LightmapSize, LightingWindowBakeSettings.Styles.LightmapSizeStrings, LightingWindowBakeSettings.Styles.LightmapSizeValues, LightingWindowBakeSettings.Styles.LightmapSize, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_TextureCompression, LightingWindowBakeSettings.Styles.TextureCompression, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_AmbientOcclusion, LightingWindowBakeSettings.Styles.AmbientOcclusion, new GUILayoutOption[0]); if (this.m_AmbientOcclusion.boolValue) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_AOMaxDistance, LightingWindowBakeSettings.Styles.AOMaxDistance, new GUILayoutOption[0]); if (this.m_AOMaxDistance.floatValue < 0f) { this.m_AOMaxDistance.floatValue = 0f; } EditorGUILayout.Slider(this.m_CompAOExponent, 0f, 10f, LightingWindowBakeSettings.Styles.AmbientOcclusionContribution, new GUILayoutOption[0]); EditorGUILayout.Slider(this.m_CompAOExponentDirect, 0f, 10f, LightingWindowBakeSettings.Styles.AmbientOcclusionContributionDirect, new GUILayoutOption[0]); EditorGUI.indentLevel--; } if (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.Radiosity) { EditorGUILayout.PropertyField(this.m_FinalGather, LightingWindowBakeSettings.Styles.FinalGather, new GUILayoutOption[0]); if (this.m_FinalGather.boolValue) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_FinalGatherRayCount, LightingWindowBakeSettings.Styles.FinalGatherRayCount, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_FinalGatherFiltering, LightingWindowBakeSettings.Styles.FinalGatherFiltering, new GUILayoutOption[0]); EditorGUI.indentLevel--; } } } } bool flag2 = SupportedRenderingFeatures.IsLightmapsModeSupported(LightmapsMode.CombinedDirectional); if (flag2 || this.m_LightmapDirectionalMode.intValue == 1) { EditorGUILayout.IntPopup(this.m_LightmapDirectionalMode, LightingWindowBakeSettings.Styles.LightmapDirectionalModeStrings, LightingWindowBakeSettings.Styles.LightmapDirectionalModeValues, LightingWindowBakeSettings.Styles.LightmapDirectionalMode, new GUILayoutOption[0]); if (!flag2) { EditorGUILayout.HelpBox("Directional Mode is not supported. Fallback will be Non-Directional.", MessageType.Warning); } } else { using (new EditorGUI.DisabledScope(true)) { EditorGUILayout.IntPopup(LightingWindowBakeSettings.Styles.LightmapDirectionalMode, 0, LightingWindowBakeSettings.Styles.LightmapDirectionalModeStrings, LightingWindowBakeSettings.Styles.LightmapDirectionalModeValues, new GUILayoutOption[0]); } } EditorGUILayout.Slider(this.m_IndirectOutputScale, 0f, 5f, LightingWindowBakeSettings.Styles.IndirectOutputScale, new GUILayoutOption[0]); EditorGUILayout.Slider(this.m_AlbedoBoost, 1f, 10f, LightingWindowBakeSettings.Styles.AlbedoBoost, new GUILayoutOption[0]); if (LightingWindowBakeSettings.LightmapParametersGUI(this.m_LightmapParameters, LightingWindowBakeSettings.Styles.DefaultLightmapParameters)) { EditorWindow.FocusWindowIfItsOpen <InspectorWindow>(); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } } } }
public override void OnInspectorGUI() { if (EditorApplication.isPlayingOrWillChangePlaymode) { EditorGUILayout.HelpBox("Changes made in play mode will not be saved.", MessageType.Warning, true); } m_QualitySettings.Update(); var settings = GetQualitySettings(); var defaults = GetDefaultQualityForPlatforms(); var selectedLevel = QualitySettings.GetQualityLevel(); EditorGUI.BeginChangeCheck(); selectedLevel = DoQualityLevelSelection(selectedLevel, settings, defaults); if (EditorGUI.EndChangeCheck()) { QualitySettings.SetQualityLevel(selectedLevel); } SetQualitySettings(settings); HandleAddRemoveQualitySetting(ref selectedLevel, defaults); SetDefaultQualityForPlatforms(defaults); GUILayout.Space(10.0f); DrawHorizontalDivider(); GUILayout.Space(10.0f); var currentSettings = m_QualitySettingsProperty.GetArrayElementAtIndex(selectedLevel); var nameProperty = currentSettings.FindPropertyRelative("name"); var pixelLightCountProperty = currentSettings.FindPropertyRelative("pixelLightCount"); var shadowsProperty = currentSettings.FindPropertyRelative("shadows"); var shadowResolutionProperty = currentSettings.FindPropertyRelative("shadowResolution"); var shadowProjectionProperty = currentSettings.FindPropertyRelative("shadowProjection"); var shadowCascadesProperty = currentSettings.FindPropertyRelative("shadowCascades"); var shadowDistanceProperty = currentSettings.FindPropertyRelative("shadowDistance"); var shadowNearPlaneOffsetProperty = currentSettings.FindPropertyRelative("shadowNearPlaneOffset"); var shadowCascade2SplitProperty = currentSettings.FindPropertyRelative("shadowCascade2Split"); var shadowCascade4SplitProperty = currentSettings.FindPropertyRelative("shadowCascade4Split"); var shadowMaskUsageProperty = currentSettings.FindPropertyRelative("shadowmaskMode"); var skinWeightsProperty = currentSettings.FindPropertyRelative("skinWeights"); var textureQualityProperty = currentSettings.FindPropertyRelative("textureQuality"); var anisotropicTexturesProperty = currentSettings.FindPropertyRelative("anisotropicTextures"); var antiAliasingProperty = currentSettings.FindPropertyRelative("antiAliasing"); var softParticlesProperty = currentSettings.FindPropertyRelative("softParticles"); var realtimeReflectionProbes = currentSettings.FindPropertyRelative("realtimeReflectionProbes"); var billboardsFaceCameraPosition = currentSettings.FindPropertyRelative("billboardsFaceCameraPosition"); var vSyncCountProperty = currentSettings.FindPropertyRelative("vSyncCount"); var lodBiasProperty = currentSettings.FindPropertyRelative("lodBias"); var maximumLODLevelProperty = currentSettings.FindPropertyRelative("maximumLODLevel"); var particleRaycastBudgetProperty = currentSettings.FindPropertyRelative("particleRaycastBudget"); var asyncUploadTimeSliceProperty = currentSettings.FindPropertyRelative("asyncUploadTimeSlice"); var asyncUploadBufferSizeProperty = currentSettings.FindPropertyRelative("asyncUploadBufferSize"); var asyncUploadPersistentBufferProperty = currentSettings.FindPropertyRelative("asyncUploadPersistentBuffer"); var resolutionScalingFixedDPIFactorProperty = currentSettings.FindPropertyRelative("resolutionScalingFixedDPIFactor"); bool usingSRP = GraphicsSettings.renderPipelineAsset != null; if (string.IsNullOrEmpty(nameProperty.stringValue)) { nameProperty.stringValue = "Level " + selectedLevel; } EditorGUILayout.PropertyField(nameProperty); if (usingSRP) { EditorGUILayout.HelpBox("A Scriptable Render Pipeline is in use, some settings will not be used and are hidden", MessageType.Info); } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Rendering"), EditorStyles.boldLabel); if (!usingSRP) { EditorGUILayout.PropertyField(pixelLightCountProperty); } // still valid with SRP EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(textureQualityProperty); if (EditorGUI.EndChangeCheck() && usingSRP) { RenderPipelineManager.CleanupRenderPipeline(); } EditorGUILayout.PropertyField(anisotropicTexturesProperty); if (!usingSRP) { EditorGUILayout.PropertyField(antiAliasingProperty); EditorGUILayout.PropertyField(softParticlesProperty); if (softParticlesProperty.boolValue) { SoftParticlesHintGUI(); } } EditorGUILayout.PropertyField(realtimeReflectionProbes); EditorGUILayout.PropertyField(billboardsFaceCameraPosition, Content.kBillboardsFaceCameraPos); EditorGUILayout.PropertyField(resolutionScalingFixedDPIFactorProperty); var streamingMipmapsActiveProperty = currentSettings.FindPropertyRelative("streamingMipmapsActive"); EditorGUILayout.PropertyField(streamingMipmapsActiveProperty, Content.kStreamingMipmapsActive); if (streamingMipmapsActiveProperty.boolValue) { EditorGUI.indentLevel++; var streamingMipmapsAddAllCameras = currentSettings.FindPropertyRelative("streamingMipmapsAddAllCameras"); EditorGUILayout.PropertyField(streamingMipmapsAddAllCameras, Content.kStreamingMipmapsAddAllCameras); var streamingMipmapsBudgetProperty = currentSettings.FindPropertyRelative("streamingMipmapsMemoryBudget"); EditorGUILayout.PropertyField(streamingMipmapsBudgetProperty, Content.kStreamingMipmapsMemoryBudget); var streamingMipmapsRenderersPerFrameProperty = currentSettings.FindPropertyRelative("streamingMipmapsRenderersPerFrame"); EditorGUILayout.PropertyField(streamingMipmapsRenderersPerFrameProperty, Content.kStreamingMipmapsRenderersPerFrame); var streamingMipmapsMaxLevelReductionProperty = currentSettings.FindPropertyRelative("streamingMipmapsMaxLevelReduction"); EditorGUILayout.PropertyField(streamingMipmapsMaxLevelReductionProperty, Content.kStreamingMipmapsMaxLevelReduction); var streamingMipmapsMaxFileIORequestsProperty = currentSettings.FindPropertyRelative("streamingMipmapsMaxFileIORequests"); EditorGUILayout.PropertyField(streamingMipmapsMaxFileIORequestsProperty, Content.kStreamingMipmapsMaxFileIORequests); EditorGUI.indentLevel--; } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Shadows"), EditorStyles.boldLabel); if (SupportedRenderingFeatures.IsMixedLightingModeSupported(MixedLightingMode.Shadowmask)) { EditorGUILayout.PropertyField(shadowMaskUsageProperty); } if (!usingSRP) { EditorGUILayout.PropertyField(shadowsProperty); EditorGUILayout.PropertyField(shadowResolutionProperty); EditorGUILayout.PropertyField(shadowProjectionProperty); EditorGUILayout.PropertyField(shadowDistanceProperty); EditorGUILayout.PropertyField(shadowNearPlaneOffsetProperty); EditorGUILayout.PropertyField(shadowCascadesProperty); if (shadowCascadesProperty.intValue == 2) { DrawCascadeSplitGUI <float>(ref shadowCascade2SplitProperty); } else if (shadowCascadesProperty.intValue == 4) { DrawCascadeSplitGUI <Vector3>(ref shadowCascade4SplitProperty); } } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Other"), EditorStyles.boldLabel); EditorGUILayout.PropertyField(skinWeightsProperty); EditorGUILayout.PropertyField(vSyncCountProperty, Content.kVSyncCountLabel); EditorGUILayout.PropertyField(lodBiasProperty, Content.kLODBiasLabel); EditorGUILayout.PropertyField(maximumLODLevelProperty); EditorGUILayout.PropertyField(particleRaycastBudgetProperty); EditorGUILayout.PropertyField(asyncUploadTimeSliceProperty); EditorGUILayout.PropertyField(asyncUploadBufferSizeProperty); EditorGUILayout.PropertyField(asyncUploadPersistentBufferProperty); asyncUploadTimeSliceProperty.intValue = Mathf.Clamp(asyncUploadTimeSliceProperty.intValue, kMinAsyncUploadTimeSlice, kMaxAsyncUploadTimeSlice); asyncUploadBufferSizeProperty.intValue = Mathf.Clamp(asyncUploadBufferSizeProperty.intValue, kMinAsyncRingBufferSize, kMaxAsyncRingBufferSize); if (m_Dragging != null && m_Dragging.m_Position != m_Dragging.m_StartPosition) { m_QualitySettingsProperty.MoveArrayElement(m_Dragging.m_StartPosition, m_Dragging.m_Position); m_Dragging.m_StartPosition = m_Dragging.m_Position; selectedLevel = m_Dragging.m_Position; m_QualitySettings.ApplyModifiedProperties(); QualitySettings.SetQualityLevel(Mathf.Clamp(selectedLevel, 0, m_QualitySettingsProperty.arraySize - 1)); } m_QualitySettings.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { if (EditorApplication.isPlayingOrWillChangePlaymode) { EditorGUILayout.HelpBox("Changes made in play mode will not be saved.", MessageType.Warning, true); } m_QualitySettings.Update(); var settings = GetQualitySettings(); var defaults = GetDefaultQualityForPlatforms(); var selectedLevel = QualitySettings.GetQualityLevel(); if (selectedLevel >= m_QualitySettingsProperty.arraySize) { selectedLevel = m_QualitySettingsProperty.arraySize - 1; } EditorGUI.BeginChangeCheck(); selectedLevel = DoQualityLevelSelection(selectedLevel, settings, defaults); if (EditorGUI.EndChangeCheck()) { QualitySettings.SetQualityLevel(selectedLevel); } SetQualitySettings(settings); HandleAddRemoveQualitySetting(ref selectedLevel, defaults); SetDefaultQualityForPlatforms(defaults); GUILayout.Space(10.0f); DrawHorizontalDivider(); GUILayout.Space(10.0f); var currentSettings = m_QualitySettingsProperty.GetArrayElementAtIndex(selectedLevel); var nameProperty = currentSettings.FindPropertyRelative("name"); var pixelLightCountProperty = currentSettings.FindPropertyRelative("pixelLightCount"); var shadowsProperty = currentSettings.FindPropertyRelative("shadows"); var shadowResolutionProperty = currentSettings.FindPropertyRelative("shadowResolution"); var shadowProjectionProperty = currentSettings.FindPropertyRelative("shadowProjection"); var shadowCascadesProperty = currentSettings.FindPropertyRelative("shadowCascades"); var shadowDistanceProperty = currentSettings.FindPropertyRelative("shadowDistance"); var shadowNearPlaneOffsetProperty = currentSettings.FindPropertyRelative("shadowNearPlaneOffset"); var shadowCascade2SplitProperty = currentSettings.FindPropertyRelative("shadowCascade2Split"); var shadowCascade4SplitProperty = currentSettings.FindPropertyRelative("shadowCascade4Split"); var shadowMaskUsageProperty = currentSettings.FindPropertyRelative("shadowmaskMode"); var skinWeightsProperty = currentSettings.FindPropertyRelative("skinWeights"); var textureQualityProperty = currentSettings.FindPropertyRelative("textureQuality"); var anisotropicTexturesProperty = currentSettings.FindPropertyRelative("anisotropicTextures"); var antiAliasingProperty = currentSettings.FindPropertyRelative("antiAliasing"); var softParticlesProperty = currentSettings.FindPropertyRelative("softParticles"); var realtimeReflectionProbes = currentSettings.FindPropertyRelative("realtimeReflectionProbes"); var billboardsFaceCameraPosition = currentSettings.FindPropertyRelative("billboardsFaceCameraPosition"); var vSyncCountProperty = currentSettings.FindPropertyRelative("vSyncCount"); var lodBiasProperty = currentSettings.FindPropertyRelative("lodBias"); var maximumLODLevelProperty = currentSettings.FindPropertyRelative("maximumLODLevel"); var enableLODCrossFadeProperty = currentSettings.FindPropertyRelative("enableLODCrossFade"); var particleRaycastBudgetProperty = currentSettings.FindPropertyRelative("particleRaycastBudget"); var asyncUploadTimeSliceProperty = currentSettings.FindPropertyRelative("asyncUploadTimeSlice"); var asyncUploadBufferSizeProperty = currentSettings.FindPropertyRelative("asyncUploadBufferSize"); var asyncUploadPersistentBufferProperty = currentSettings.FindPropertyRelative("asyncUploadPersistentBuffer"); var resolutionScalingFixedDPIFactorProperty = currentSettings.FindPropertyRelative("resolutionScalingFixedDPIFactor"); var customRenderPipeline = currentSettings.FindPropertyRelative("customRenderPipeline"); bool usingSRP = GraphicsSettings.currentRenderPipeline != null; if (string.IsNullOrEmpty(nameProperty.stringValue)) { nameProperty.stringValue = "Level " + selectedLevel; } GUILayout.Label(EditorGUIUtility.TempContent("Current Active Quality Level"), EditorStyles.boldLabel); EditorGUILayout.PropertyField(nameProperty); if (usingSRP) { EditorGUILayout.HelpBox("A Scriptable Render Pipeline is in use, some settings will not be used and are hidden", MessageType.Info); } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Rendering"), EditorStyles.boldLabel); EditorGUI.RenderPipelineAssetField(Content.kRenderPipelineObject, m_QualitySettings, customRenderPipeline); if (!usingSRP && customRenderPipeline.objectReferenceValue != null) { EditorGUILayout.HelpBox("Missing a Scriptable Render Pipeline in Graphics: \"Scriptable Render Pipeline Settings\" to use Scriptable Render Pipeline from Quality: \"Custom Render Pipeline\".", MessageType.Warning); } if (!usingSRP) { EditorGUILayout.PropertyField(pixelLightCountProperty); } // still valid with SRP if (!usingSRP) { EditorGUILayout.PropertyField(antiAliasingProperty); } if (!SupportedRenderingFeatures.active.overridesRealtimeReflectionProbes) { EditorGUILayout.PropertyField(realtimeReflectionProbes); } EditorGUILayout.PropertyField(resolutionScalingFixedDPIFactorProperty); EditorGUILayout.PropertyField(vSyncCountProperty, Content.kVSyncCountLabel); if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android || EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS || EditorUserBuildSettings.activeBuildTarget == BuildTarget.tvOS) { if (vSyncCountProperty.intValue > 0) { EditorGUILayout.HelpBox(EditorGUIUtility.TrTextContent($"VSync Count '{vSyncCountProperty.enumLocalizedDisplayNames[vSyncCountProperty.enumValueIndex]}' is ignored on Android, iOS and tvOS.", EditorGUIUtility.GetHelpIcon(MessageType.Warning))); } } bool shadowMaskSupported = SupportedRenderingFeatures.IsMixedLightingModeSupported(MixedLightingMode.Shadowmask); bool showShadowMaskUsage = shadowMaskSupported && !SupportedRenderingFeatures.active.overridesShadowmask; GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Textures"), EditorStyles.boldLabel); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(textureQualityProperty); if (EditorGUI.EndChangeCheck() && usingSRP) { RenderPipelineManager.CleanupRenderPipeline(); } if (QualitySettings.IsTextureResReducedOnAnyPlatform()) { MipStrippingHintGUI(); } EditorGUILayout.PropertyField(anisotropicTexturesProperty); var streamingMipmapsActiveProperty = currentSettings.FindPropertyRelative("streamingMipmapsActive"); EditorGUILayout.PropertyField(streamingMipmapsActiveProperty, Content.kStreamingMipmapsActive); if (streamingMipmapsActiveProperty.boolValue) { EditorGUI.indentLevel++; var streamingMipmapsAddAllCameras = currentSettings.FindPropertyRelative("streamingMipmapsAddAllCameras"); EditorGUILayout.PropertyField(streamingMipmapsAddAllCameras, Content.kStreamingMipmapsAddAllCameras); var streamingMipmapsBudgetProperty = currentSettings.FindPropertyRelative("streamingMipmapsMemoryBudget"); EditorGUILayout.PropertyField(streamingMipmapsBudgetProperty, Content.kStreamingMipmapsMemoryBudget); var streamingMipmapsRenderersPerFrameProperty = currentSettings.FindPropertyRelative("streamingMipmapsRenderersPerFrame"); EditorGUILayout.PropertyField(streamingMipmapsRenderersPerFrameProperty, Content.kStreamingMipmapsRenderersPerFrame); var streamingMipmapsMaxLevelReductionProperty = currentSettings.FindPropertyRelative("streamingMipmapsMaxLevelReduction"); EditorGUILayout.PropertyField(streamingMipmapsMaxLevelReductionProperty, Content.kStreamingMipmapsMaxLevelReduction); var streamingMipmapsMaxFileIORequestsProperty = currentSettings.FindPropertyRelative("streamingMipmapsMaxFileIORequests"); EditorGUILayout.PropertyField(streamingMipmapsMaxFileIORequestsProperty, Content.kStreamingMipmapsMaxFileIORequests); EditorGUI.indentLevel--; } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Particles"), EditorStyles.boldLabel); if (!usingSRP) { EditorGUILayout.PropertyField(softParticlesProperty); if (softParticlesProperty.boolValue) { SoftParticlesHintGUI(); } } EditorGUILayout.PropertyField(particleRaycastBudgetProperty); GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Terrain"), EditorStyles.boldLabel); EditorGUILayout.PropertyField(billboardsFaceCameraPosition, Content.kBillboardsFaceCameraPos); if (!usingSRP || showShadowMaskUsage) { GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Shadows"), EditorStyles.boldLabel); if (showShadowMaskUsage) { EditorGUILayout.PropertyField(shadowMaskUsageProperty); } if (!usingSRP) { EditorGUILayout.PropertyField(shadowsProperty); EditorGUILayout.PropertyField(shadowResolutionProperty); EditorGUILayout.PropertyField(shadowProjectionProperty); EditorGUILayout.PropertyField(shadowDistanceProperty); EditorGUILayout.PropertyField(shadowNearPlaneOffsetProperty); EditorGUILayout.PropertyField(shadowCascadesProperty); if (shadowCascadesProperty.intValue == 2) { DrawCascadeSplitGUI <float>(ref shadowCascade2SplitProperty); } else if (shadowCascadesProperty.intValue == 4) { DrawCascadeSplitGUI <Vector3>(ref shadowCascade4SplitProperty); } } } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Async Asset Upload"), EditorStyles.boldLabel); EditorGUILayout.PropertyField(asyncUploadTimeSliceProperty, Content.kAsyncUploadTimeSlice); EditorGUILayout.PropertyField(asyncUploadBufferSizeProperty, Content.kAsyncUploadBufferSize); EditorGUILayout.PropertyField(asyncUploadPersistentBufferProperty, Content.kAsyncUploadPersistentBuffer); asyncUploadTimeSliceProperty.intValue = Mathf.Clamp(asyncUploadTimeSliceProperty.intValue, kMinAsyncUploadTimeSlice, kMaxAsyncUploadTimeSlice); asyncUploadBufferSizeProperty.intValue = Mathf.Clamp(asyncUploadBufferSizeProperty.intValue, kMinAsyncRingBufferSize, kMaxAsyncRingBufferSize); GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Level of Detail"), EditorStyles.boldLabel); if (!SupportedRenderingFeatures.active.overridesLODBias) { EditorGUILayout.PropertyField(lodBiasProperty, Content.kLODBiasLabel); } if (!SupportedRenderingFeatures.active.overridesMaximumLODLevel) { EditorGUILayout.PropertyField(maximumLODLevelProperty, Content.kMaximumLODLevelLabel); } if (!SupportedRenderingFeatures.active.overridesEnableLODCrossFade) { EditorGUILayout.PropertyField(enableLODCrossFadeProperty, Content.kEnableLODCrossFadeLabel); } GUILayout.Space(10); GUILayout.Label(EditorGUIUtility.TempContent("Meshes"), EditorStyles.boldLabel); EditorGUILayout.PropertyField(skinWeightsProperty); if (m_Dragging != null && m_Dragging.m_Position != m_Dragging.m_StartPosition) { m_QualitySettingsProperty.MoveArrayElement(m_Dragging.m_StartPosition, m_Dragging.m_Position); m_Dragging.m_StartPosition = m_Dragging.m_Position; selectedLevel = m_Dragging.m_Position; m_QualitySettings.ApplyModifiedProperties(); QualitySettings.SetQualityLevel(Mathf.Clamp(selectedLevel, 0, m_QualitySettingsProperty.arraySize - 1)); } m_QualitySettings.ApplyModifiedProperties(); }