brunomikoski/ScriptableObjectCollection

Error when leaving the edit drawer open on a script

JoaoLReis opened this issue · 4 comments

I have a script with a CollectableScriptableObject variable.
On the editor, I open the edit drawer and if I leave it open when I select another object in the hierarchy, when I come back the scriptable object is broken and throwing an error OnGUI. It seems to only happen when leaving the drawer open.

Bug2.mp4

ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:122)
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:309)
UnityEditor.EditorGUILayout.BeginVertical (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9437)
UnityEditor.EditorGUILayout.BeginVertical (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9427)
UnityEditor.EditorGUILayout+VerticalScope..ctor (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9405)
BrunoMikoski.ScriptableObjectCollections.CollectableScriptableObjectPropertyDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.brunomikoski.scriptableobjectcollection@8f5ee34a96/Scripts/Editor/CollectableScriptableObjectPropertyDrawer.cs:109)
UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at /Users/bokken/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:23)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at /Users/bokken/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:139)
UnityEditor.GenericInspector.OnOptimizedInspectorGUI (UnityEngine.Rect contentRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/GenericInspector.cs:106)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:520)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)

I'm unable to reproduce this on the current version 1.6.1, I made a lot of changes to how this inline editor is displayed.

new-inline-editor.mp4

Do you mind trying it on the newer version? If it's not an option please let me know what version you are using so I can make a hotfix.

Thanks for looking into it! We will try updating to the latest version and I'll come back to you since we are a few minors behind. Sorry for the late answer.

Thanks for looking into it! We will try updating to the latest version and I'll come back to you since we are a few minors behind. Sorry for the late answer.

Sounds great! I will be waiting :)

I will assume this is fixed, let me know if you encounter this issue again @JoaoLReis .