如何处理此“ InvalidOperationException:确保只能从主线程中调用确保运行运行中主线程”

时间:2019-05-18 12:05:09

标签: visual-studio unity3d

我已经很长一段时间都收到此错误了,不知道是什么错误。也不影响我的进步!

完整的错误消息:

 InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread
 UnityEngine.Object.EnsureRunningOnMainThread () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:153)
 UnityEngine.Object.GetInstanceID () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:73)
 UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:182)
 UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:140)
 UnityEngine.Object.op_Inequality (UnityEngine.Object x, UnityEngine.Object y) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:405)
 UnityEditor.ProGrids.GridRenderer.Destroy () (at Library/PackageCache/com.unity.progrids@3.0.3-preview.0/Editor/GridRenderer.cs:85)
 UnityEditor.ProGrids.ProGridsEditor.Destroy () (at Library/PackageCache/com.unity.progrids@3.0.3-preview.0/Editor/ProGridsEditor.cs:409)
 UnityEditor.ProGrids.ProGridsEditor.Finalize () (at Library/PackageCache/com.unity.progrids@3.0.3-preview.0/Editor/ProGridsEditor.cs:370)
 UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

它看起来像是ProGrids 303中的错误。它们是从工作线程开始的,最终无法通过。忽视。肯定会在下一次更新时消失。