您的位置:首页 > 移动开发 > Unity3D

unity DestroyBuffer can only be called from the main thread

2016-02-24 14:59 1521 查看


DestroyBuffer 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.

多线程时会产生这个错误

还有使用设备延迟或者卡住的时候也会产生这个错误(比如kinect造成)

另外调试的时候程序切换后台也有一定几率导致这个错误(可以试试user setting里面开后台运行)

更多参考
http://answers.unity3d.com/questions/830973/c-calling-destroy-in-a-custom-class-destructor.html http://forum.unity3d.com/threads/destroy-can-only-be-called-from-the-main-thread-useless-error.262494/ http://www.cnblogs.com/jiangjieqim/p/4500861.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: