当前位置:   article > 正文

unity中WWW isDone方法只能在主线程中调用

unity中WWW isDone方法只能在主线程中调用

项目中要使用动态加载,原计划是生成WWW对象后,放到一个容器里。由一个独立线程轮询容器里的对象,如果www.isDone为true时,回调一个接口把结果交给请求方。

new Thread( new ThreadStart( XXX.run ) );

运行以后出现下面问题:

详细错误:

get_isDone  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 initiali

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/235984?site
推荐阅读
相关标签
  

闽ICP备14008679号