解决报错-Setting the parent of a tra

2023-03-19  本文已影响0人  一枚64byte的仙女

1.Setting the parent of a transform which resides in a Prefab**

Setting the parent of a transform which resides in a Prefab Asset is disabled to prevent data corruption 

2.解析

设置位于预置体内中资产去转换父元素是禁用的,以防止数据损坏

因为只是加载了该预制体,但是呢,没有进行实例化

3.解决方案

方案 :把加载出来的预制体进行实例化,不懂的话,可以看我如下的代码,提供参考

实例化函数:GameObject.Instantiate()//参数:预制体

上一篇 下一篇

猜你喜欢

热点阅读