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

Unity crashes when clicking on a GameObject with Component of Entitas #1064

Open
RouderSky opened this issue Jun 16, 2023 · 10 comments
Open

Comments

@RouderSky
Copy link

RouderSky commented Jun 16, 2023

StackOverflowException: The requested operation caused a stack overflow.
System.Reflection.RuntimePropertyInfo.SetValue (System.Object obj, System.Object value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) (at <75633565436c42f0a6426b33f0132ade>:0)
System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) (at <75633565436c42f0a6426b33f0132ade>:0)
DesperateDevs.Utils.PublicMemberInfo.SetValue (System.Object obj, System.Object value) (at <3cf8f6667aa14c75815ce075234101f0>:0)
Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawObjectMember (System.Type memberType, System.String memberName, System.Object value, System.Object target, System.Action2[T1,T2] setValue) (at <67872ecda0424e09adcde3cfef7ad8d6>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawObjectMember (System.Type memberType, System.String memberName, System.Object value, System.Object target, System.Action2[T1,T2] setValue) (at <67872ecda0424e09adcde3cfef7ad8d6>:0)
@RouderSky RouderSky changed the title 点击有Component的GameObject时Unity崩溃了 Unity crashes when clicking on a GameObject with Component of Entitas Jun 16, 2023
@RouderSky
Copy link
Author

RouderSky commented Jun 16, 2023

ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEngine.GUILayout.DoButton (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEngine.GUILayout.Button (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <44335255efcb428fb633c913db3eed7a>:0)
DesperateDevs.Unity.Editor.EditorLayout.miniButton (System.String c, UnityEngine.GUIStyle style) (at <055a4d22d68a41038b16fe2b4ed852d5>:0)
DesperateDevs.Unity.Editor.EditorLayout.MiniButton (System.String c) (at <055a4d22d68a41038b16fe2b4ed852d5>:0)
Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawObjectMember (System.Type memberType, System.String memberName, System.Object value, System.Object target, System.Action2[T1,T2] setValue) (at <67872ecda0424e09adcde3cfef7ad8d6>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawObjectMember (System.Type memberType, System.String memberName, System.Object value, System.Object target, System.Action2[T1,T2] setValue) (at <67872ecda0424e09adcde3cfef7ad8d6>:0)

@RouderSky
Copy link
Author

RouderSky commented Jun 16, 2023

ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEngine.GUILayoutUtility.GetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <44335255efcb428fb633c913db3eed7a>:0)
UnityEditor.EditorGUILayout.GetToggleRect (System.Boolean hasLabel, UnityEngine.GUILayoutOption[] options) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.EditorGUILayout.Toggle (UnityEngine.GUIContent label, System.Boolean value, UnityEngine.GUILayoutOption[] options) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.EditorGUILayout.Toggle (System.String label, System.Boolean value, UnityEngine.GUILayoutOption[] options) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
Entitas.VisualDebugging.Unity.Editor.BoolTypeDrawer.DrawAndGetNewValue (System.Type memberType, System.String memberName, System.Object value, System.Object target) (at <67872ecda0424e09adcde3cfef7ad8d6>:0)
Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawObjectMember (System.Type memberType, System.String memberName, System.Object value, System.Object target, System.Action2[T1,T2] setValue) (at <67872ecda0424e09adcde3cfef7ad8d6>:0) Entitas.VisualDebugging.Unity.Editor.EntityDrawer.DrawObjectMember (System.Type memberType, System.String memberName, System.Object value, System.Object target, System.Action2[T1,T2] setValue) (at <67872ecda0424e09adcde3cfef7ad8d6>:0)

@sschmid
Copy link
Owner

sschmid commented Jun 19, 2023

Hi! Can you pls post you component?
I assume it doesn't have a non trivial type. Entitas entity drawer in Visual Debugging tries to draw any kind of type, in some cases it cannot find a way and will result in a stack overflow. In this case you can either choose to implement your own TypeDrawer or ComponentDrawer, see examples

or add an attribute to now draw the component

@RouderSky
Copy link
Author

I don't know which component caused the crash, because there are many components on this GameObject

@sschmid sschmid added this to Entitas Jul 2, 2023
@github-project-automation github-project-automation bot moved this to Todo in Entitas Jul 2, 2023
@sschmid sschmid added this to the future-release milestone Jul 3, 2023
@sschmid sschmid moved this from Todo to Backlog in Entitas Jul 3, 2023
@sschmid sschmid removed this from the future-release milestone Jul 3, 2023
@Discipol
Copy link

Discipol commented Jul 6, 2023

I also get this when inspecting any entity in 2022.3.4

@alex-moonlitgames
Copy link

This is potentially a duplicate of #1067

@RouderSky
Copy link
Author

RouderSky commented Jul 22, 2023

I know which component is causing the problem
微信截图_20230722170518
I suspect it is AniLayerCfg, can it not be drawn in the inspector interface?
@sschmid

@sschmid
Copy link
Owner

sschmid commented Jul 22, 2023

Yes, see comment above: #1064 (comment)

Add [DontDrawComponent] or implement a custom drawer for the component, like

public class Vector3TypeDrawer : ITypeDrawer

@RouderSky
Copy link
Author

Yes, see comment above: #1064 (comment)

Add [DontDrawComponent] or implement a custom drawer for the component, like

public class Vector3TypeDrawer : ITypeDrawer

How do I know which attribute caused the failure?

@RouderSky
Copy link
Author

RouderSky commented Jul 13, 2024

image
#1067

I have replaced the dll in this post, but still get the error

My unity version is 2021.3.30f1

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

No branches or pull requests

4 participants