UnityEditor.LightingWindowObjectTab.isBuiltIn C# (CSharp) Method

isBuiltIn() private static method

private static isBuiltIn ( UnityEditor.SerializedProperty prop ) : bool
prop UnityEditor.SerializedProperty
return bool
        private static bool isBuiltIn(SerializedProperty prop)
        {
            if (prop.objectReferenceValue != null)
            {
                LightmapParameters objectReferenceValue = prop.objectReferenceValue as LightmapParameters;
                return (objectReferenceValue.hideFlags == HideFlags.NotEditable);
            }
            return true;
        }

Usage Example

Beispiel #1
0
        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 (LightingWindowObjectTab.isBuiltIn(prop))
            {
                text = "View";
            }
            bool result = false;

            if (prop.objectReferenceValue == null)
            {
                SerializedObject   serializedObject   = new SerializedObject(LightmapEditorSettings.GetLightmapSettings());
                SerializedProperty serializedProperty = serializedObject.FindProperty("m_LightmapEditorSettings.m_LightmapParameters");
                using (new EditorGUI.DisabledScope(serializedProperty == null))
                {
                    if (GUILayout.Button(text, EditorStyles.miniButton, new GUILayoutOption[]
                    {
                        GUILayout.ExpandWidth(false)
                    }))
                    {
                        Selection.activeObject = serializedProperty.objectReferenceValue;
                        result = true;
                    }
                }
            }
            else if (GUILayout.Button(text, EditorStyles.miniButton, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(false)
            }))
            {
                Selection.activeObject = prop.objectReferenceValue;
                result = true;
            }
            EditorGUILayout.EndHorizontal();
            return(result);
        }