"xxxxxx 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."
xxxxxx只能在主线程运行:
1.解决方法,将报错定位的东西放在Start或Awake中执行
2.(特殊情况:有不应该在这时出现的预制体出现在场景中,也会报这个 错而且具体定位,这时将其删除就行了)