Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Expandable attribute doesn't work for list of scriptable objects #242

Open
jessyrobinson opened this issue Jun 24, 2021 · 1 comment

Comments

@jessyrobinson
Copy link

Defining a serializable a list of scriptable objects with the Expandable attribute gives you continuous errors:

NullReferenceException: Object reference not set to an instance of an object
NaughtyAttributes.Editor.PropertyUtility.GetPropertyType (UnityEditor.SerializedProperty property) (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/Utility/PropertyUtility.cs:182)
NaughtyAttributes.Editor.ExpandablePropertyDrawer.OnGUI_Internal (UnityEngine.Rect rect, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/PropertyDrawers/ExpandablePropertyDrawer.cs:70)
NaughtyAttributes.Editor.PropertyDrawerBase.OnGUI (UnityEngine.Rect rect, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs:30)
UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditorInternal.ReorderableList+Defaults.DrawElement (UnityEngine.Rect rect, UnityEditor.SerializedProperty element, System.Object listItem, System.Boolean selected, System.Boolean focused, System.Boolean draggable, System.Boolean editable) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditorInternal.ReorderableListWrapper.Draw (UnityEngine.GUIContent label, UnityEngine.Rect r, UnityEngine.Rect visibleArea, System.Boolean includeChildren) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <9540aba417024bb296674f70fa788b73>:0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <9540aba417024bb296674f70fa788b73>:0)
NaughtyAttributes.Editor.NaughtyEditorGUI.DrawPropertyField_Layout (UnityEngine.Rect rect, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/Utility/NaughtyEditorGUI.cs:37)
NaughtyAttributes.Editor.NaughtyEditorGUI.PropertyField_Implementation (UnityEngine.Rect rect, UnityEditor.SerializedProperty property, System.Boolean includeChildren, NaughtyAttributes.Editor.NaughtyEditorGUI+PropertyFieldFunction propertyFieldFunction) (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/Utility/NaughtyEditorGUI.cs:89)
NaughtyAttributes.Editor.NaughtyEditorGUI.PropertyField_Layout (UnityEditor.SerializedProperty property, System.Boolean includeChildren) (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/Utility/NaughtyEditorGUI.cs:27)
NaughtyAttributes.Editor.NaughtyInspector.DrawSerializedProperties () (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/NaughtyInspector.cs:87)
NaughtyAttributes.Editor.NaughtyInspector.OnInspectorGUI () (at Assets/Packages/ThirdParty/NaughtyAttributes/Scripts/Editor/NaughtyInspector.cs:47)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <ab574a2f598240d68c66d280c533b9d3>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
@dbrizov dbrizov changed the title Expandable attribute doesn't work for list of scriptable objects [Issue] Expandable attribute doesn't work for list of scriptable objects Jun 26, 2021
@Hrober0
Copy link

Hrober0 commented Sep 4, 2024

I had the same issues.
This is solution:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants