internal static void Place(GameObject go, GameObject parent) { Transform defaultObjectTransform = SceneView.GetDefaultParentObjectIfSet(); if (parent != null) { SetGameObjectParent(go, parent.transform); } else if (defaultObjectTransform != null) { SetGameObjectParent(go, defaultObjectTransform); } else { // When creating a 3D object without a parent, this option puts it at the world origin instead of scene pivot. if (placeObjectsAtWorldOrigin) { go.transform.position = Vector3.zero; } else { SceneView.PlaceGameObjectInFrontOfSceneView(go); } StageUtility.PlaceGameObjectInCurrentStage(go); // may change parent } // Only at this point do we know the actual parent of the object and can modify its name accordingly. GameObjectUtility.EnsureUniqueNameForSibling(go); Undo.SetCurrentGroupName("Create " + go.name); EditorWindow.FocusWindowIfItsOpen <SceneHierarchyWindow>(); Selection.activeGameObject = go; }
internal static void Place(GameObject go, GameObject parent) { if (parent != null) { var transform = go.transform; Undo.SetTransformParent(transform, parent.transform, "Reparenting"); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; go.layer = parent.layer; if (parent.GetComponent <RectTransform>()) { ObjectFactory.AddComponent <RectTransform>(go); } } else { SceneView.PlaceGameObjectInFrontOfSceneView(go); StageUtility.PlaceGameObjectInCurrentStage(go); // may change parent } // Only at this point do we know the actual parent of the object and can mopdify its name accordingly. GameObjectUtility.EnsureUniqueNameForSibling(go); Undo.SetCurrentGroupName("Create " + go.name); EditorWindow.FocusWindowIfItsOpen <SceneHierarchyWindow>(); Selection.activeGameObject = go; }
internal static void Place(GameObject go, GameObject parent) { if (parent != null) { Transform transform = go.transform; transform.SetParent(parent.transform, false); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; go.layer = parent.layer; if (parent.GetComponent <RectTransform>()) { ObjectFactory.AddComponent <RectTransform>(go); } } SceneView.PlaceGameObjectInFrontOfSceneView(go); EditorWindow.FocusWindowIfItsOpen <SceneHierarchyWindow>(); Selection.activeGameObject = go; }
/// <summary> /// Draws a hint next to an object in the Hierarchy, if it exists and the Hierarchy is visible. /// </summary> /// <param name="hint">The content of the hint</param> /// <param name="objectInHierarchy">The object the hint will be drawn next to</param> public static void DrawHintNextToHierarchyObject(DynamicHintContent hint, GameObject objectInHierarchy) { if (!EditorWindow.HasOpenInstances <SceneHierarchyWindow>()) { return; } EditorWindow.FocusWindowIfItsOpen <SceneHierarchyWindow>(); Rect rectOfObject = GetRectOfObjectInHierarchy(objectInHierarchy, out bool objectWasFound); if (!objectWasFound) { return; } AdaptRectToHierarchy(out Rect rectOfHint, GUIUtility.GUIToScreenPoint(new Vector2(rectOfObject.x, rectOfObject.y)), rectOfObject); DrawHintAt(hint, rectOfHint); }
/// <summary> /// Draws a hint next to a visible field in the Inspector. /// </summary> /// <param name="hint">The content of the hint</param> /// <param name="fieldPathInClass">The path of the field within the class</param> /// <param name="targetType">The type of the class that contains the field</param> public static void DrawHintNextToInspectorField(DynamicHintContent hint, string fieldPathInClass, Type targetType) { if (!EditorWindow.HasOpenInstances <InspectorWindow>()) { return; } EditorWindow.FocusWindowIfItsOpen <InspectorWindow>(); Rect rectOfObject = GetRectOfFieldInInspector(fieldPathInClass, targetType, out bool objectWasFound); if (!objectWasFound) { return; } AdaptRectToInspector(out Rect rectOfHint, GUIUtility.GUIToScreenPoint(new Vector2(rectOfObject.x, rectOfObject.y))); DrawHintAt(hint, rectOfHint); }
/// <summary> /// Draws a hint next to a visible asset in the Project Window. /// </summary> /// <param name="hint">The content of hint tooltip</param> /// <param name="objectToFind">The object the hint will be drawn next to</param> public static void DrawHintNextToProjectAsset(DynamicHintContent hint, UnityEngine.Object objectToFind) { if (!EditorWindow.HasOpenInstances <ProjectBrowser>()) { return; } EditorWindow.FocusWindowIfItsOpen <ProjectBrowser>(); Rect rectOfObject = GetRectOfObjectInProjectExplorer(objectToFind, out bool objectWasFound); if (!objectWasFound) { return; } AdaptRectToProjectWindow(out Rect rectOfHint, GUIUtility.GUIToScreenPoint(new Vector2(rectOfObject.x, rectOfObject.y))); DrawHintAt(hint, rectOfHint); }
internal static void Place(GameObject go, GameObject parent) { if (parent != null) { var transform = go.transform; Undo.SetTransformParent(transform, parent.transform, "Reparenting"); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; go.layer = parent.layer; if (parent.GetComponent <RectTransform>()) { ObjectFactory.AddComponent <RectTransform>(go); } } else { // When creating a 3D object without a parent, this option puts it at the world origin instead of scene pivot. if (EditorPrefs.GetBool("Create3DObject.PlaceAtWorldOrigin", false)) { go.transform.position = Vector3.zero; } else { SceneView.PlaceGameObjectInFrontOfSceneView(go); } StageUtility.PlaceGameObjectInCurrentStage(go); // may change parent } // Only at this point do we know the actual parent of the object and can modify its name accordingly. GameObjectUtility.EnsureUniqueNameForSibling(go); Undo.SetCurrentGroupName("Create " + go.name); EditorWindow.FocusWindowIfItsOpen <SceneHierarchyWindow>(); Selection.activeGameObject = go; }
public static void FocusWindowIfItsOpen <T>() where T : EditorWindow { EditorWindow.FocusWindowIfItsOpen(typeof(T)); }
private void GeneralLightmapSettingsGUI() { this.m_ShowGeneralLightmapSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowGeneralLightmapSettings, LightingWindowBakeSettings.Styles.GeneralLightmapLabel, true); if (this.m_ShowGeneralLightmapSettings) { EditorGUI.indentLevel++; using (new EditorGUI.DisabledScope(!LightModeUtil.Get().IsAnyGIEnabled())) { using (new EditorGUI.DisabledScope(!LightModeUtil.Get().AreBakedLightmapsEnabled())) { EditorGUILayout.PropertyField(this.m_BakeBackend, LightingWindowBakeSettings.Styles.BakeBackend, new GUILayoutOption[0]); if (LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(this.m_PVRCulling, LightingWindowBakeSettings.Styles.PVRCulling, new GUILayoutOption[0]); if (LightmapEditorSettings.giPathTracerSampling != LightmapEditorSettings.PathTracerSampling.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++; GUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.IntSlider(this.m_PVRFilteringGaussRadiusDirect, 0, 5, LightingWindowBakeSettings.Styles.PVRFilteringGaussRadiusDirect, new GUILayoutOption[0]); GUILayout.Label(" texels", LightingWindowBakeSettings.Styles.LabelStyle, new GUILayoutOption[0]); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.IntSlider(this.m_PVRFilteringGaussRadiusIndirect, 0, 5, LightingWindowBakeSettings.Styles.PVRFilteringGaussRadiusIndirect, new GUILayoutOption[0]); GUILayout.Label(" texels", LightingWindowBakeSettings.Styles.LabelStyle, new GUILayoutOption[0]); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.IntSlider(this.m_PVRFilteringGaussRadiusAO, 0, 5, LightingWindowBakeSettings.Styles.PVRFilteringGaussRadiusAO, new GUILayoutOption[0]); GUILayout.Label(" texels", LightingWindowBakeSettings.Styles.LabelStyle, new GUILayoutOption[0]); GUILayout.EndHorizontal(); EditorGUI.indentLevel--; } EditorGUILayout.HelpBox(LightingWindowBakeSettings.Styles.NoTransparencyAndLODInProgressive.text, MessageType.Warning); EditorGUI.indentLevel--; EditorGUILayout.Space(); } } using (new EditorGUI.DisabledScope(LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer && !LightModeUtil.Get().IsRealtimeGIEnabled())) { LightingWindowBakeSettings.DrawResolutionField(this.m_Resolution, LightingWindowBakeSettings.Styles.IndirectResolution); } using (new EditorGUI.DisabledScope(!LightModeUtil.Get().AreBakedLightmapsEnabled())) { 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.giBakeBackend == LightmapEditorSettings.GIBakeBackend.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--; } } } EditorGUILayout.IntPopup(this.m_LightmapDirectionalMode, LightingWindowBakeSettings.Styles.LightmapDirectionalModeStrings, LightingWindowBakeSettings.Styles.LightmapDirectionalModeValues, LightingWindowBakeSettings.Styles.LightmapDirectionalMode, new GUILayoutOption[0]); if (this.m_LightmapDirectionalMode.intValue == 1) { EditorGUILayout.HelpBox(LightingWindowBakeSettings.Styles.NoDirectionalInSM2AndGLES2.text, MessageType.Warning); } 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(); } } }
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(); } } }
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(); } } } }