jeffcampbellmakesgames / Entitas-Redux

An entity-component framework for Unity with code generation and visual debugging
MIT License
102 stars 13 forks source link

[BUG] Custom inspectors for systems and entities are broken #71

Open JesseTG opened 1 year ago

JesseTG commented 1 year ago

Describe the bug

Various custom inspectors are broken, as shown in the attached screenshots.

Unity Version: Unity 2023.1.5f1

To Reproduce Steps to reproduce the behavior:

  1. Open any scene in which entities and systems are used
  2. Select their associated objects in the hierarchy
  3. Look at the inspector

Expected behavior

The custom inspectors should render without issues.

Screenshots

Screenshot 2023-07-25 103139 Screenshot 2023-07-25 103118 Screenshot 2023-07-25 103056

Additional context

Here are some relevant exceptions:

[Exception] NullReferenceException: Object reference not set to an instance of an object
GUILayoutUtility.DoGetRect() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayoutUtility.GetRect() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayout.DoTextField() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayout.TextField() at <1b7ba2395c4741668d0e335ad4e651c7>:0
EditorGUILayoutTools.SearchTextField() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/Editor/Tools/EditorGUILayoutTools.cs:148
EntityDrawer.DrawComponents() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/Editor/Inspector/Entity/EntityDrawer.cs:340
EntityDrawer.DrawEntity() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/Editor/Inspector/Entity/EntityDrawer.cs:216
EntityLinkInspector.OnInspectorGUI() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/VisualDebugging/Editor/EntityLinkInspector.cs:63
InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0() at <8bcfff76472c48f096bf077900dc8a3a>:0
GUIUtility.ProcessEvent()
[Exception] ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint
Aborting
GUILayoutGroup.GetNext() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayoutUtility.DoGetRect() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayoutUtility.GetRect() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayout.DoTextField() at <1b7ba2395c4741668d0e335ad4e651c7>:0
GUILayout.TextField() at <1b7ba2395c4741668d0e335ad4e651c7>:0
EditorGUILayoutTools.SearchTextField() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/Editor/Tools/EditorGUILayoutTools.cs:148
EntityDrawer.DrawComponents() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/Editor/Inspector/Entity/EntityDrawer.cs:340
EntityDrawer.DrawEntity() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/Editor/Inspector/Entity/EntityDrawer.cs:216
EntityLinkInspector.OnInspectorGUI() at ./Library/PackageCache/com.jeffcampbellmakesgames.entitasredux@2.1.4/Scripts/VisualDebugging/Editor/EntityLinkInspector.cs:63
InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0() at <8bcfff76472c48f096bf077900dc8a3a>:0
GUIUtility.ProcessEvent()