sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7.18k stars 1.11k forks source link

Entity Behaviour in Unity inspector not visible #1079

Closed bthan7 closed 1 year ago

bthan7 commented 1 year ago

Describe the bug When I wanted to check entity's components by using unity hierarchy window , I select that entity which I would like to check for what the entity is what is the components of entity. Unity throw a exception and Entity behavior section on inspector tab is completely broken.

  1. Create an entity and add some components on it.
  2. Find the game object which belongs to that entity.
  3. Click the game object.
  4. Check inspector window and see error

Expected behavior Unity throw a exception and components section on inspector tab is completely broken.

Screenshots Screenshot 2023-10-10 at 16 10 54 Screenshot 2023-10-10 at 16 11 01 Screenshot 2023-10-10 at 16 11 10

Additional context NullReferenceException: Object reference not set to an instance of an object UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayoutUtility.cs:424) UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayoutUtility.cs:415) UnityEngine.GUILayout.DoTextField (System.String text, System.Int32 maxLength, System.Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayout.cs:92) UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayout.cs:50) DesperateDevs.Unity.Editor.EditorLayout.SearchTextField (System.String searchString) (at <9ff0a1a5457d4eddb8114f062f92b646>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawComponents (Entitas.IEntity entity) (at :0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawEntity (Entitas.IEntity entity) (at :0) Entitas.VisualDebugging.Unity.Editor.EntityInspector.OnInspectorGUI () (at :0) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.b__0 () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:713) UnityEditor.InspectorWindow:RedrawFromNative() (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/InspectorWindow.cs:195)

AND

ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint Aborting UnityEngine.GUILayoutGroup.GetNext () (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/LayoutGroup.cs:127) UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayoutUtility.cs:458) UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayoutUtility.cs:415) UnityEngine.GUILayout.DoTextField (System.String text, System.Int32 maxLength, System.Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayout.cs:92) UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUILayout.cs:50) DesperateDevs.Unity.Editor.EditorLayout.SearchTextField (System.String searchString) (at <9ff0a1a5457d4eddb8114f062f92b646>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawComponents (Entitas.IEntity entity) (at :0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawEntity (Entitas.IEntity entity) (at :0) Entitas.VisualDebugging.Unity.Editor.EntityInspector.OnInspectorGUI () (at :0) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.b__0 () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:713) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

To Reproduce Steps to reproduce the behavior:

  1. Create an entity and add some components on it.
  2. Find the game object which belongs to that entity.
  3. Click the game object.
  4. Check inspector window and see error

UNITY VERSION -> 2022.3.10f1 ENTITAS VERSION -> 1.14.1

mchamplain commented 1 year ago

You can replace the dll

See: https://github.com/sschmid/Entitas/issues/1067#issuecomment-1623734894

bthan7 commented 1 year ago

Oh I couldn't see the that thread, anyway thanks for this @mchamplain

Cheers,