Exemplo n.º 1
0
 private void PreviewSection()
 {
     if (this.m_Mode != LightingWindow.Mode.LightingSettings)
     {
         EditorGUILayout.BeginHorizontal(GUIContent.none, "preToolbar", new GUILayoutOption[]
         {
             GUILayout.Height(17f)
         });
         GUILayout.FlexibleSpace();
         GUI.Label(GUILayoutUtility.GetLastRect(), "Preview", "preToolbar2");
         EditorGUILayout.EndHorizontal();
     }
     LightingWindow.Mode mode = this.m_Mode;
     if (mode != LightingWindow.Mode.OutputMaps)
     {
         if (mode == LightingWindow.Mode.ObjectSettings)
         {
             Rect r = new Rect(0f, 180f, base.position.width, base.position.height - 180f);
             if (Selection.activeGameObject)
             {
                 this.m_ObjectTab.ObjectPreview(r);
             }
         }
     }
     else
     {
         float num = this.m_PreviewResizer.ResizeHandle(base.position, 100f, 250f, 17f);
         Rect  r2  = new Rect(0f, base.position.height - num, base.position.width, num);
         if (num > 0f)
         {
             this.m_LightmapPreviewTab.LightmapPreview(r2);
         }
     }
 }
Exemplo n.º 2
0
        private void GeneralSettingsGUI(SerializedObject so, SerializedProperty enableRealtimeGI, SerializedProperty enableBakedGI)
        {
            this.m_ShowGeneralSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowGeneralSettings, LightingWindow.styles.GeneralGILabel);
            if (!this.m_ShowGeneralSettings)
            {
                return;
            }
            SerializedProperty property           = so.FindProperty("m_GISettings.m_AlbedoBoost");
            SerializedProperty property2          = so.FindProperty("m_GISettings.m_IndirectOutputScale");
            SerializedProperty property3          = so.FindProperty("m_LightmapEditorSettings.m_TextureWidth");
            SerializedProperty prop               = so.FindProperty("m_LightmapEditorSettings.m_LightmapParameters");
            SerializedProperty serializedProperty = so.FindProperty("m_LightmapsMode");
            bool flag = enableBakedGI.boolValue || enableRealtimeGI.boolValue;

            EditorGUI.BeginDisabledGroup(!flag);
            EditorGUI.indentLevel++;
            EditorGUILayout.IntPopup(serializedProperty, this.kModeStrings, this.kModeValues, LightingWindow.s_Styles.DirectionalMode, new GUILayoutOption[0]);
            if (serializedProperty.intValue == 2)
            {
                EditorGUILayout.HelpBox(LightingWindow.s_Styles.NoDirectionalSpecularInSM2AndGLES2.text, MessageType.Warning);
            }
            EditorGUILayout.Slider(property2, 0f, 5f, LightingWindow.styles.IndirectOutputScale, new GUILayoutOption[0]);
            EditorGUILayout.Slider(property, 1f, 10f, LightingWindow.styles.AlbedoBoost, new GUILayoutOption[0]);
            if (LightingWindowObjectTab.LightmapParametersGUI(prop, LightingWindow.styles.DefaultLightmapParameters))
            {
                this.m_Mode = LightingWindow.Mode.ObjectSettings;
            }
            EditorGUILayout.IntPopup(property3, this.kMaxAtlasSizeStrings, this.kMaxAtlasSizeValues, LightingWindow.styles.MaxAtlasSize, new GUILayoutOption[0]);
            this.DeveloperBuildEnlightenSettings(so);
            EditorGUI.EndDisabledGroup();
            EditorGUI.indentLevel--;
        }
Exemplo n.º 3
0
 private void ModeToggle()
 {
     this.m_Mode = (LightingWindow.Mode)GUILayout.Toolbar((int)this.m_Mode, LightingWindow.styles.ModeToggles, (GUIStyle)"LargeButton", new GUILayoutOption[1]
     {
         GUILayout.Width(this.position.width - 76f)
     });
 }
Exemplo n.º 4
0
 private void PreviewSection()
 {
     if (this.m_Mode == LightingWindow.Mode.OutputMaps)
     {
         EditorGUILayout.BeginHorizontal(GUIContent.none, LightingWindow.Styles.ToolbarStyle, new GUILayoutOption[]
         {
             GUILayout.Height(17f)
         });
         GUILayout.FlexibleSpace();
         GUI.Label(GUILayoutUtility.GetLastRect(), "Preview", LightingWindow.Styles.ToolbarTitleStyle);
         EditorGUILayout.EndHorizontal();
     }
     LightingWindow.Mode mode = this.m_Mode;
     if (mode != LightingWindow.Mode.OutputMaps)
     {
         if (mode == LightingWindow.Mode.ObjectSettings)
         {
             int  num = (LightmapEditorSettings.lightmapper != LightmapEditorSettings.Lightmapper.PathTracer) ? 115 : 185;
             Rect r   = new Rect(0f, (float)num, base.position.width, base.position.height - (float)num);
             if (Selection.activeGameObject)
             {
                 this.m_ObjectTab.ObjectPreview(r);
             }
         }
     }
     else
     {
         float num2 = this.m_PreviewResizer.ResizeHandle(base.position, 100f, 250f, 17f);
         Rect  r2   = new Rect(0f, base.position.height - num2, base.position.width, num2);
         if (num2 > 0f)
         {
             this.m_LightmapPreviewTab.LightmapPreview(r2);
         }
     }
 }
Exemplo n.º 5
0
 private void ModeToggle()
 {
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     this.m_Mode = (LightingWindow.Mode)GUILayout.Toolbar((int)this.m_Mode, LightingWindow.Styles.ModeToggles, LightingWindow.Styles.ButtonStyle, GUI.ToolbarButtonSize.FitToContents, new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     EditorGUILayout.EndHorizontal();
 }
Exemplo n.º 6
0
        private void ModeToggle()
        {
            float width = base.position.width - 76f;

            this.m_Mode = (LightingWindow.Mode)GUILayout.Toolbar((int)this.m_Mode, LightingWindow.styles.ModeToggles, "LargeButton", new GUILayoutOption[]
            {
                GUILayout.Width(width)
            });
        }
Exemplo n.º 7
0
        private void ModeToggle()
        {
            float width = base.position.width - this.toolbarPadding * 2f;

            this.m_Mode = (LightingWindow.Mode)GUILayout.Toolbar((int)this.m_Mode, LightingWindow.Styles.ModeToggles, LightingWindow.Styles.ButtonStyle, new GUILayoutOption[]
            {
                GUILayout.Width(width)
            });
        }
Exemplo n.º 8
0
 private void OnGUI()
 {
     LightModeUtil.Get().Load();
     EditorGUIUtility.labelWidth = 130f;
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Space(this.toolbarPadding);
     this.ModeToggle();
     GUILayout.FlexibleSpace();
     this.DrawHelpGUI();
     if (this.m_Mode == LightingWindow.Mode.LightingSettings)
     {
         this.DrawSettingsGUI();
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.Space();
     LightingWindow.Mode mode = this.m_Mode;
     if (mode != LightingWindow.Mode.LightingSettings)
     {
         if (mode != LightingWindow.Mode.OutputMaps)
         {
             if (mode != LightingWindow.Mode.ObjectSettings)
             {
             }
         }
         else
         {
             this.m_ScrollPositionOutputMaps = EditorGUILayout.BeginScrollView(this.m_ScrollPositionOutputMaps, new GUILayoutOption[0]);
             this.m_LightmapPreviewTab.Maps();
             EditorGUILayout.EndScrollView();
             EditorGUILayout.Space();
         }
     }
     else
     {
         this.m_ScrollPositionLighting = EditorGUILayout.BeginScrollView(this.m_ScrollPositionLighting, new GUILayoutOption[0]);
         this.m_LightingTab.OnGUI();
         EditorGUILayout.EndScrollView();
         EditorGUILayout.Space();
     }
     this.Buttons();
     this.Summary();
     this.PreviewSection();
     if (LightModeUtil.Get().Flush())
     {
         InspectorWindow.RepaintAllInspectors();
     }
 }
Exemplo n.º 9
0
 private void OnGUI()
 {
     this.UpdateAnimatedBools(false);
     EditorGUIUtility.labelWidth = 130f;
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Space(this.toolbarPadding);
     this.ModeToggle();
     GUILayout.FlexibleSpace();
     this.DrawHelpGUI();
     if (this.m_Mode == LightingWindow.Mode.BakeSettings)
     {
         this.DrawSettingsGUI();
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.Space();
     this.m_ScrollPosition = EditorGUILayout.BeginScrollView(this.m_ScrollPosition, new GUILayoutOption[0]);
     LightingWindow.Mode mode = this.m_Mode;
     if (mode != LightingWindow.Mode.ObjectSettings)
     {
         if (mode != LightingWindow.Mode.BakeSettings)
         {
             if (mode == LightingWindow.Mode.Maps)
             {
                 this.m_LightmapPreviewTab.Maps();
             }
         }
         else
         {
             this.lightingEditor.OnInspectorGUI();
             this.EnlightenBakeSettings();
             this.fogEditor.OnInspectorGUI();
             this.otherRenderingEditor.OnInspectorGUI();
         }
     }
     else
     {
         this.m_ObjectTab.ObjectSettings();
     }
     EditorGUILayout.EndScrollView();
     EditorGUILayout.Space();
     GUI.enabled = !EditorApplication.isPlayingOrWillChangePlaymode;
     this.Buttons();
     GUI.enabled = true;
     EditorGUILayout.Space();
     this.Summary();
     this.PreviewSection();
 }
Exemplo n.º 10
0
 private void OnGUI()
 {
     this.InitLightmapSettings();
     this.m_LightmapSettings.Update();
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Space(this.toolbarPadding);
     this.ModeToggle();
     this.DrawHelpGUI();
     if (this.m_Mode == LightingWindow.Mode.LightingSettings)
     {
         this.DrawSettingsGUI();
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.Space();
     LightingWindow.Mode mode = this.m_Mode;
     if (mode != LightingWindow.Mode.LightingSettings)
     {
         if (mode != LightingWindow.Mode.OutputMaps)
         {
             if (mode != LightingWindow.Mode.ObjectSettings)
             {
             }
         }
         else
         {
             this.m_ScrollPositionOutputMaps = EditorGUILayout.BeginScrollView(this.m_ScrollPositionOutputMaps, new GUILayoutOption[0]);
             this.m_LightmapPreviewTab.Maps();
             EditorGUILayout.EndScrollView();
             EditorGUILayout.Space();
         }
     }
     else
     {
         this.m_ScrollPositionLighting = EditorGUILayout.BeginScrollView(this.m_ScrollPositionLighting, new GUILayoutOption[0]);
         this.m_LightingTab.OnGUI();
         EditorGUILayout.EndScrollView();
         EditorGUILayout.Space();
     }
     this.Buttons();
     this.Summary();
     this.PreviewSection();
     this.m_LightmapSettings.ApplyModifiedProperties();
 }
Exemplo n.º 11
0
 private void GeneralSettingsGUI(SerializedObject so, bool enableRealtimeGI, bool enableBakedGI)
 {
     this.m_ShowGeneralSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowGeneralSettings, LightingWindow.styles.GeneralGILabel);
     if (this.m_ShowGeneralSettings)
     {
         SerializedProperty serializedProperty = so.FindProperty("m_GISettings.m_AlbedoBoost");
         SerializedProperty property           = so.FindProperty("m_GISettings.m_IndirectOutputScale");
         SerializedProperty prop = so.FindProperty("m_LightmapEditorSettings.m_LightmapParameters");
         SerializedProperty serializedProperty2 = so.FindProperty("m_LightmapEditorSettings.m_LightmapsBakeMode");
         bool flag = enableBakedGI || enableRealtimeGI;
         EditorGUI.indentLevel++;
         using (new EditorGUI.DisabledScope(!flag))
         {
             EditorGUILayout.IntPopup(serializedProperty2, this.kModeStrings, this.kModeValues, LightingWindow.s_Styles.DirectionalMode, new GUILayoutOption[0]);
             if (serializedProperty2.intValue == 1)
             {
                 EditorGUILayout.HelpBox(LightingWindow.s_Styles.NoDirectionalInSM2AndGLES2.text, MessageType.Warning);
             }
             if (serializedProperty2.intValue == 2)
             {
                 EditorGUILayout.HelpBox(LightingWindow.s_Styles.NoDirectionalSpecularInSM2AndGLES2.text, MessageType.Warning);
             }
             EditorGUILayout.Slider(property, 0f, 5f, LightingWindow.styles.IndirectOutputScale, new GUILayoutOption[0]);
             EditorGUI.BeginChangeCheck();
             EditorGUILayout.Slider(serializedProperty, 1f, 10f, LightingWindow.styles.AlbedoBoost, new GUILayoutOption[0]);
             if (EditorGUI.EndChangeCheck())
             {
                 Lightmapping.bounceBoost = serializedProperty.floatValue;
             }
             if (LightingWindowObjectTab.LightmapParametersGUI(prop, LightingWindow.styles.DefaultLightmapParameters, false))
             {
                 this.m_Mode = LightingWindow.Mode.ObjectSettings;
             }
             this.DeveloperBuildEnlightenSettings(so);
         }
         EditorGUI.indentLevel--;
     }
 }
Exemplo n.º 12
0
		private void GeneralSettingsGUI(SerializedObject so, SerializedProperty enableRealtimeGI, SerializedProperty enableBakedGI)
		{
			this.m_ShowGeneralSettings = EditorGUILayout.FoldoutTitlebar(this.m_ShowGeneralSettings, LightingWindow.styles.GeneralGILabel);
			if (!this.m_ShowGeneralSettings)
			{
				return;
			}
			SerializedProperty property = so.FindProperty("m_GISettings.m_AlbedoBoost");
			SerializedProperty property2 = so.FindProperty("m_GISettings.m_IndirectOutputScale");
			SerializedProperty property3 = so.FindProperty("m_LightmapEditorSettings.m_TextureWidth");
			SerializedProperty prop = so.FindProperty("m_LightmapEditorSettings.m_LightmapParameters");
			SerializedProperty serializedProperty = so.FindProperty("m_LightmapsMode");
			bool flag = enableBakedGI.boolValue || enableRealtimeGI.boolValue;
			EditorGUI.BeginDisabledGroup(!flag);
			EditorGUI.indentLevel++;
			EditorGUILayout.IntPopup(serializedProperty, this.kModeStrings, this.kModeValues, LightingWindow.s_Styles.DirectionalMode, new GUILayoutOption[0]);
			if (serializedProperty.intValue == 2)
			{
				EditorGUILayout.HelpBox(LightingWindow.s_Styles.NoDirectionalSpecularInSM2AndGLES2.text, MessageType.Warning);
			}
			EditorGUILayout.Slider(property2, 0f, 5f, LightingWindow.styles.IndirectOutputScale, new GUILayoutOption[0]);
			EditorGUILayout.Slider(property, 1f, 10f, LightingWindow.styles.AlbedoBoost, new GUILayoutOption[0]);
			if (LightingWindowObjectTab.LightmapParametersGUI(prop, LightingWindow.styles.DefaultLightmapParameters))
			{
				this.m_Mode = LightingWindow.Mode.ObjectSettings;
			}
			EditorGUILayout.IntPopup(property3, this.kMaxAtlasSizeStrings, this.kMaxAtlasSizeValues, LightingWindow.styles.MaxAtlasSize, new GUILayoutOption[0]);
			this.DeveloperBuildEnlightenSettings(so);
			EditorGUI.EndDisabledGroup();
			EditorGUI.indentLevel--;
		}
Exemplo n.º 13
0
		private void ModeToggle()
		{
			float width = base.position.width - 76f;
			this.m_Mode = (LightingWindow.Mode)GUILayout.Toolbar((int)this.m_Mode, LightingWindow.styles.ModeToggles, "LargeButton", new GUILayoutOption[]
			{
				GUILayout.Width(width)
			});
		}