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

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

Open
Discipol opened this issue Jul 6, 2023 · 16 comments
Labels

Comments

@Discipol
Copy link

Discipol commented Jul 6, 2023

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&)

@sschmid sschmid added the bug label Jul 6, 2023
@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

@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?

@Discipol
Copy link
Author

Discipol commented Jul 6, 2023

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

@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

I can reproduce on 2022.3.4f1

@alex-moonlitgames
Copy link

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

@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

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");

@Discipol
Copy link
Author

Discipol commented Jul 6, 2023

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 ?

@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

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

@Discipol
Copy link
Author

Discipol commented Jul 6, 2023

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

@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

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

@Discipol
Copy link
Author

Discipol commented Jul 6, 2023

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/

@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

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.

@Discipol
Copy link
Author

Discipol commented Jul 6, 2023

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

@sschmid sschmid changed the title Multiple exceptions + broken inspector when looking at any entity in 2022.3.4f1 [SOLVED] Unity 2022.3.4f1: Exceptions + broken inspector when looking at any entity Jul 6, 2023
@sschmid
Copy link
Owner

sschmid commented Jul 6, 2023

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

@rubenwe
Copy link

rubenwe commented Jul 20, 2023

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

@synthetic-w
Copy link

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

@Ave-nue
Copy link

Ave-nue commented Sep 4, 2023

You really saved me!!!

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

No branches or pull requests

6 participants