You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UnityEngine.UnityException: ToString can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at (wrapper managed-to-native) UnityEngine.Object.ToString(UnityEngine.Object)
at UnityEngine.Object.ToString () [0x00001] in <4a31731933e0419ca5a995305014ad37>:0
at ILRuntime.Runtime.Debugger.VariableInfo.FromObject (System.Object obj, System.Boolean retriveType) [0x0001f] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\VariableInfo.cs:156
at ILRuntime.Runtime.Debugger.DebugService.ResolveMember (System.Object obj, System.Type objType, System.String name, System.Type[] parameterTypes, System.Object[] parameters, System.Object& res) [0x000b1] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\DebugService.cs:1435
at ILRuntime.Runtime.Debugger.DebugService.ResolveVariable (System.Int32 threadHashCode, System.Int32 frameIndex, ILRuntime.Runtime.Debugger.VariableReference variable, System.Object& res) [0x00322] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\DebugService.cs:1270
at ILRuntime.Runtime.Debugger.DebuggerServer.OnReceive (ILRuntime.Runtime.Debugger.DebugMessageType type, System.Byte[] buffer) [0x0033e] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\DebuggerServer\DebuggerServer.cs:270
查看某个类的对像的值时,所有成员GameObject类型的成员会报错(不确定其它unity类会不会,没注意),但c#库里的类型不会. 这样对调试造成很大的不便, 这里不能发截图.群我进不去.报错是这样的:
UnityEngine.UnityException: ToString can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at (wrapper managed-to-native) UnityEngine.Object.ToString(UnityEngine.Object)
at UnityEngine.Object.ToString () [0x00001] in <4a31731933e0419ca5a995305014ad37>:0
at ILRuntime.Runtime.Debugger.VariableInfo.FromObject (System.Object obj, System.Boolean retriveType) [0x0001f] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\VariableInfo.cs:156
at ILRuntime.Runtime.Debugger.DebugService.ResolveMember (System.Object obj, System.Type objType, System.String name, System.Type[] parameterTypes, System.Object[] parameters, System.Object& res) [0x000b1] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\DebugService.cs:1435
at ILRuntime.Runtime.Debugger.DebugService.ResolveVariable (System.Int32 threadHashCode, System.Int32 frameIndex, ILRuntime.Runtime.Debugger.VariableReference variable, System.Object& res) [0x00322] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\DebugService.cs:1270
at ILRuntime.Runtime.Debugger.DebuggerServer.OnReceive (ILRuntime.Runtime.Debugger.DebugMessageType type, System.Byte[] buffer) [0x0033e] in E:\UnityProject\Plaza\Library\PackageCache\[email protected]\Runtime\Debugger\DebuggerServer\DebuggerServer.cs:270
我在报错的位置打印该对象的ToString()是没有问题的:
mainObject_.ToString():Canvas (UnityEngine.GameObject)
The text was updated successfully, but these errors were encountered: