public bool Begin() { if (LightingSettingsInspector.s_Styles == null) { LightingSettingsInspector.s_Styles = new LightingSettingsInspector.Styles(); } this.m_ShowSettings = EditorGUILayout.Foldout(this.m_ShowSettings, LightingSettingsInspector.s_Styles.Lighting); bool result; if (!this.m_ShowSettings) { result = false; } else { EditorGUI.indentLevel++; result = true; } return(result); }
public void RenderTerrainSettings() { if (LightingSettingsInspector.s_Styles == null) { LightingSettingsInspector.s_Styles = new LightingSettingsInspector.Styles(); } if (this.m_SerializedObject != null && this.m_GameObjectsSerializedObject != null && this.m_GameObjectsSerializedObject.targetObjects.Length != 0) { this.m_GameObjectsSerializedObject.Update(); this.LightmapStaticSettings(); if (!LightModeUtil.Get().IsAnyGIEnabled() && !this.isPrefabAsset) { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.GINotEnabledInfo.text, MessageType.Info); } else { bool flag = (this.m_StaticEditorFlags.intValue & 1) != 0; if (flag) { this.m_ShowLightmapSettings = EditorGUILayout.Foldout(this.m_ShowLightmapSettings, LightingSettingsInspector.s_Styles.LightmapSettings); if (this.m_ShowLightmapSettings) { EditorGUI.indentLevel++; using (new EditorGUI.DisabledScope(!flag)) { if (GUI.enabled) { this.ShowTerrainChunks(this.m_Terrains); } float lightmapScale = this.LightmapScaleGUI(1f); TerrainData terrainData = this.m_Terrains[0].terrainData; float cachedSurfaceArea = (!(terrainData != null)) ? 0f : (terrainData.size.x * terrainData.size.z); this.ShowClampedSizeInLightmapGUI(lightmapScale, cachedSurfaceArea); LightingSettingsInspector.LightmapParametersGUI(this.m_LightmapParameters, LightingSettingsInspector.s_Styles.LightmapParameters); if (GUI.enabled && this.m_Terrains.Length == 1 && this.m_Terrains[0].terrainData != null) { this.ShowBakePerformanceWarning(this.m_Terrains[0]); } this.m_ShowBakedLM = EditorGUILayout.Foldout(this.m_ShowBakedLM, LightingSettingsInspector.s_Styles.Atlas); if (this.m_ShowBakedLM) { this.ShowAtlasGUI(this.m_Terrains[0].GetInstanceID()); } this.m_ShowRealtimeLM = EditorGUILayout.Foldout(this.m_ShowRealtimeLM, LightingSettingsInspector.s_Styles.RealtimeLM); if (this.m_ShowRealtimeLM) { this.ShowRealtimeLMGUI(this.m_Terrains[0]); } this.m_SerializedObject.ApplyModifiedProperties(); } EditorGUI.indentLevel--; } GUILayout.Space(10f); } else { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.TerrainLightmapInfoBox.text, MessageType.Info); } } } }
public void RenderMeshSettings(bool showLightmapSettings) { if (LightingSettingsInspector.s_Styles == null) { LightingSettingsInspector.s_Styles = new LightingSettingsInspector.Styles(); } if (this.m_SerializedObject != null && this.m_GameObjectsSerializedObject != null && this.m_GameObjectsSerializedObject.targetObjects.Length != 0) { this.m_GameObjectsSerializedObject.Update(); EditorGUILayout.PropertyField(this.m_CastShadows, LightingSettingsInspector.s_Styles.CastShadows, true, new GUILayoutOption[0]); bool disabled = SceneView.IsUsingDeferredRenderingPath(); using (new EditorGUI.DisabledScope(disabled)) { EditorGUILayout.PropertyField(this.m_ReceiveShadows, LightingSettingsInspector.s_Styles.ReceiveShadows, true, new GUILayoutOption[0]); } EditorGUILayout.PropertyField(this.m_MotionVectors, LightingSettingsInspector.s_Styles.MotionVectors, true, new GUILayoutOption[0]); if (showLightmapSettings) { this.LightmapStaticSettings(); if (!LightModeUtil.Get().IsAnyGIEnabled() && !this.isPrefabAsset) { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.GINotEnabledInfo.text, MessageType.Info); } else { bool flag = (this.m_StaticEditorFlags.intValue & 1) != 0; if (flag) { this.m_ShowChartingSettings = EditorGUILayout.Foldout(this.m_ShowChartingSettings, LightingSettingsInspector.s_Styles.UVCharting); if (this.m_ShowChartingSettings) { this.RendererUVSettings(); } this.m_ShowLightmapSettings = EditorGUILayout.Foldout(this.m_ShowLightmapSettings, LightingSettingsInspector.s_Styles.LightmapSettings); if (this.m_ShowLightmapSettings) { EditorGUI.indentLevel++; float num = LightmapVisualization.GetLightmapLODLevelScale(this.m_Renderers[0]); for (int i = 1; i < this.m_Renderers.Length; i++) { if (!Mathf.Approximately(num, LightmapVisualization.GetLightmapLODLevelScale(this.m_Renderers[i]))) { num = 1f; } } float lightmapScale = this.LightmapScaleGUI(num) * LightmapVisualization.GetLightmapLODLevelScale(this.m_Renderers[0]); float cachedMeshSurfaceArea = InternalMeshUtil.GetCachedMeshSurfaceArea((MeshRenderer)this.m_Renderers[0]); this.ShowClampedSizeInLightmapGUI(lightmapScale, cachedMeshSurfaceArea); EditorGUILayout.PropertyField(this.m_ImportantGI, LightingSettingsInspector.s_Styles.ImportantGI, new GUILayoutOption[0]); LightingSettingsInspector.LightmapParametersGUI(this.m_LightmapParameters, LightingSettingsInspector.s_Styles.LightmapParameters); this.m_ShowBakedLM = EditorGUILayout.Foldout(this.m_ShowBakedLM, LightingSettingsInspector.s_Styles.Atlas); if (this.m_ShowBakedLM) { this.ShowAtlasGUI(this.m_Renderers[0].GetInstanceID()); } this.m_ShowRealtimeLM = EditorGUILayout.Foldout(this.m_ShowRealtimeLM, LightingSettingsInspector.s_Styles.RealtimeLM); if (this.m_ShowRealtimeLM) { this.ShowRealtimeLMGUI(this.m_Renderers[0]); } EditorGUI.indentLevel--; } if (LightmapEditorSettings.HasZeroAreaMesh(this.m_Renderers[0])) { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.ZeroAreaPackingMesh.text, MessageType.Warning); } if (LightmapEditorSettings.HasClampedResolution(this.m_Renderers[0])) { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.ClampedPackingResolution.text, MessageType.Warning); } if (!LightingSettingsInspector.HasNormals(this.m_Renderers[0])) { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.NoNormalsNoLightmapping.text, MessageType.Warning); } this.m_SerializedObject.ApplyModifiedProperties(); } else { EditorGUILayout.HelpBox(LightingSettingsInspector.s_Styles.LightmapInfoBox.text, MessageType.Info); } } } } }