UnityEditor.LightingWindowObjectTab.LightmapParametersGUI C# (CSharp) Method

LightmapParametersGUI() public static method

public static LightmapParametersGUI ( UnityEditor.SerializedProperty prop, GUIContent content, bool advancedParameters ) : bool
prop UnityEditor.SerializedProperty
content UnityEngine.GUIContent
advancedParameters bool
return bool
        public static bool LightmapParametersGUI(SerializedProperty prop, GUIContent content, bool advancedParameters)
        {
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            if (advancedParameters)
            {
                EditorGUIInternal.AssetPopup<LightmapParameters>(prop, content, "giparams", "Default scene parameter");
            }
            else
            {
                EditorGUIInternal.AssetPopup<LightmapParameters>(prop, content, "giparams", "Default-Medium");
            }
            string text = "Edit...";
            if (isBuiltIn(prop))
            {
                text = "View";
            }
            bool flag = false;
            if (prop.objectReferenceValue == null)
            {
                SerializedProperty property = new SerializedObject(LightmapEditorSettings.GetLightmapSettings()).FindProperty("m_LightmapEditorSettings.m_LightmapParameters");
                using (new EditorGUI.DisabledScope(property == null))
                {
                    GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
                    if (GUILayout.Button(text, EditorStyles.miniButton, options))
                    {
                        Selection.activeObject = property.objectReferenceValue;
                        flag = true;
                    }
                }
            }
            else
            {
                GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
                if (GUILayout.Button(text, EditorStyles.miniButton, optionArray2))
                {
                    Selection.activeObject = prop.objectReferenceValue;
                    flag = true;
                }
            }
            EditorGUILayout.EndHorizontal();
            return flag;
        }

Usage Example

示例#1
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--;
        }
All Usage Examples Of UnityEditor.LightingWindowObjectTab::LightmapParametersGUI