Entitas icon indicating copy to clipboard operation
Entitas copied to clipboard

[SOLVED] Unity 2022.3.4f1: Exceptions + broken inspector when looking at any entity

Open Discipol opened this issue 1 year ago • 16 comments

We changed from 2021.3.15f1 to 2022.3.4f1 LTS and we are getting:

https://i.imgur.com/lshS1hz.png https://i.imgur.com/lshS1hz.png

ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint Aborting UnityEngine.GUILayoutGroup.GetNext () (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayout.DoTextField (System.String text, System.Int32 maxLength, System.Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) DesperateDevs.Unity.Editor.EditorLayout.SearchTextField (System.String searchString) (at <9ff0a1a5457d4eddb8114f062f92b646>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawComponents (Entitas.IEntity entity) (at <f1544e3e0d2e4da6bdf8e29f48f3a186>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawEntity (Entitas.IEntity entity) (at <f1544e3e0d2e4da6bdf8e29f48f3a186>:0) Entitas.VisualDebugging.Unity.Editor.EntityInspector.OnInspectorGUI () (at <f1544e3e0d2e4da6bdf8e29f48f3a186>:0) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <da771086bc2e4cfc9ad0a72e083a7f98>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

NullReferenceException: Object reference not set to an instance of an object UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayout.DoTextField (System.String text, System.Int32 maxLength, System.Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <82a3a4e0a0a94de5afddd345f6cf50d1>:0) DesperateDevs.Unity.Editor.EditorLayout.SearchTextField (System.String searchString) (at <9ff0a1a5457d4eddb8114f062f92b646>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawComponents (Entitas.IEntity entity) (at <f1544e3e0d2e4da6bdf8e29f48f3a186>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawEntity (Entitas.IEntity entity) (at <f1544e3e0d2e4da6bdf8e29f48f3a186>:0) Entitas.VisualDebugging.Unity.Editor.EntityInspector.OnInspectorGUI () (at <f1544e3e0d2e4da6bdf8e29f48f3a186>:0) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <da771086bc2e4cfc9ad0a72e083a7f98>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Discipol avatar Jul 06 '23 12:07 Discipol

@Discipol I checked Match-One in Unity 2022.3.0 using Entitas 1.14.1. Looks a normal.

Is the 2022.3.4f1 patch version the problem? Are you on Entitas 1.14.1?

Could you try Match-One to find out more about the issue?

sschmid avatar Jul 06 '23 12:07 sschmid

@sschmid We are using 1.14.1 Unity 2022.3.4f1 are replicating the exact same issue for Match-One

Discipol avatar Jul 06 '23 12:07 Discipol

I can reproduce on 2022.3.4f1

sschmid avatar Jul 06 '23 13:07 sschmid

I can reproduce on 2022.3.4f1

We have a live game with Entitas, and 2022 has a lot of Editor fixes we need (including some patched memory leaks) We can go to 2022.3.0 for the moment if fixing this bug comes in the next version of Entitas

alex-moonlitgames avatar Jul 06 '23 13:07 alex-moonlitgames

I found the issue and can fix. Unity finally fixed a type in their Editor UI, which now broke the EntityDrawer (typo was 'Seach' instead of 'Search')

old:

public static GUIStyle ToolbarSearchTextField =>
    _toolbarSearchTextField ??= GUI.skin.FindStyle("ToolbarSeachTextField");

public static GUIStyle ToolbarSearchCancelButtonStyle =>
    _toolbarSearchCancelButtonStyle ??= GUI.skin.FindStyle("ToolbarSeachCancelButton");

new:

public static GUIStyle ToolbarSearchTextField =>
    _toolbarSearchTextField ??= GUI.skin.FindStyle("ToolbarSearchTextField");

public static GUIStyle ToolbarSearchCancelButtonStyle =>
    _toolbarSearchCancelButtonStyle ??= GUI.skin.FindStyle("ToolbarSearchCancelButton");

sschmid avatar Jul 06 '23 13:07 sschmid

I found the issue and can fix. Unity finally fixed a type in their Editor UI, which now broke the EntityDrawer (typo was 'Seach' instead of 'Search')

old:

public static GUIStyle ToolbarSearchTextField =>
    _toolbarSearchTextField ??= GUI.skin.FindStyle("ToolbarSeachTextField");

public static GUIStyle ToolbarSearchCancelButtonStyle =>
    _toolbarSearchCancelButtonStyle ??= GUI.skin.FindStyle("ToolbarSeachCancelButton");

new:

public static GUIStyle ToolbarSearchTextField =>
    _toolbarSearchTextField ??= GUI.skin.FindStyle("ToolbarSearchTextField");

public static GUIStyle ToolbarSearchCancelButtonStyle =>
    _toolbarSearchCancelButtonStyle ??= GUI.skin.FindStyle("ToolbarSearchCancelButton");

Ha, classic xD

Do you intend on a 1.14.2 release for this or it will come alongside the anticipated Roslyn update @sschmid ?

Discipol avatar Jul 06 '23 13:07 Discipol

I will distribute Entitas as sources in the future so we can use #if UNITY_XYZ. Since I cannot do that in the dll, I will attach a hotfix dll here. Because when I fix the issue for Unity 2022.3.4. I will break it for versions before that

sschmid avatar Jul 06 '23 13:07 sschmid

I will distribute Entitas as sources in the future so we can use #if UNITY_XYZ. Since I cannot do that in the dll, I will attach a hotfix dll here. Because when I fix the issue for Unity 2022.3.4. I will break it for versions before that

I appreciate the help @sschmid

Discipol avatar Jul 06 '23 13:07 Discipol

In the meantime, it would be great if someone could check which Unity patch version introduced that change from ToolbarSeachTextField to ToolbarSearchTextField, either by downloading and checking if the EntityDrawer is broken, or maybe there's a place on the internet where we can see Unity's code changes

sschmid avatar Jul 06 '23 13:07 sschmid

In the meantime, it would be great if someone could check which Unity patch version introduced that change from ToolbarSeachTextField to ToolbarSearchTextField, either by downloading and checking if the EntityDrawer is broken, or maybe there's a place on the internet where we can see Unity's code changes

This guy reports that the typo does not work in 2022.3.1f1 https://forum.unity.com/threads/unable-to-use-input-system-panel.1450204/

Discipol avatar Jul 06 '23 13:07 Discipol

CI is running: https://github.com/sschmid/DesperateDevs/actions/runs/5476346196

Here is the updated dll: DesperateDevs.Unity.Editor.dll.zip

Please overwrite the old dll.

sschmid avatar Jul 06 '23 14:07 sschmid

CI is running: https://github.com/sschmid/DesperateDevs/actions/runs/5476346196

Here is the updated dll: DesperateDevs.Unity.Editor.dll.zip

Please overwrite the old dll.

Dll replacement worked beautifully. Thanks again Simon

Discipol avatar Jul 06 '23 15:07 Discipol

I'll keep the issue open for a while for visibility

sschmid avatar Jul 06 '23 15:07 sschmid

If other folks are also still on 1.13.0 and hitting this and don't want to upgrade, here's a patched DLL for that. (Edited with dnSpy). DesperateDevs.Unity.Editor.zip

rubenwe avatar Jul 20 '23 16:07 rubenwe

If other folks are also still on 1.13.0 and hitting this and don't want to upgrade, here's a patched DLL for that. (Edited with dnSpy). DesperateDevs.Unity.Editor.zip

Appreciate it

synthetic-w avatar Aug 30 '23 07:08 synthetic-w

You really saved me!!!

Ave-nue avatar Sep 04 '23 16:09 Ave-nue