开发中遇到的报错-Setting the parent of a transform which resides in a prefab is disabled
来源:互联网 发布:vps绑定域名 编辑:程序博客网 时间:2024/06/07 01:27
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
导致问题原因是,用Resouce.Load加载一个prefab,没有实例化直接设置parent 所以导致错误,错误原因就是没有实例化的prefab 不能直接操作transform,会导致预制数据损坏
eg:GameObject effect = Resource.Load("effect") as GameObject;
effect.transform.parent = transform; (error)
GameObject effect = Instantiate(Resource.Load("effect")) as GameObject;
effect.transform.parent = transform; (right)
导致问题原因是,用Resouce.Load加载一个prefab,没有实例化直接设置parent 所以导致错误,错误原因就是没有实例化的prefab 不能直接操作transform,会导致预制数据损坏
eg:GameObject effect = Resource.Load("effect") as GameObject;
effect.transform.parent = transform; (error)
GameObject effect = Instantiate(Resource.Load("effect")) as GameObject;
effect.transform.parent = transform; (right)
0 0
- 开发中遇到的报错-Setting the parent of a transform which resides in a prefab is disabled
- 【Unity报错】Setting the parent of a transform which resides in a prefab is disabled to prevent data cor
- Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption
- 12.Which is the correct description of a pinned buffer in the database buffer cache?
- The DCOM settings which are independent of whether the PC is in a work group or in a domain
- Question 8: In which of the following scenarios is a Copy Constructor called or invoked?
- 166.View the Exhibit and examine the setting for a table. Which statement is true about the PCTFR
- 使用JSONObject转换json数据报错:There is a cycle in the hierarchy!的解决办法
- VT-x is disabled in the BIOS android开发遇到的第一个问题 vts BIOS设置
- mac idea 执行报错Class JavaLaunchHelper is implemented in both *. One of the two will be used. Which one
- cocos2d-x-2.2.5 Eclipse编译报错 error: 'transform' is not a member of 'std' (IOS没有问题)
- 62.You are in the middle of a transaction updating a very important table. The machine on which a da
- 关于Xcode报错This application is modifying the autolayout engine from a background thread, which can lea
- Oracle Http Server安装mod_python,运行报错fatal: Not a git repository (or any of the parent directories)
- git远程库与本地联系报错:fatal: Not a git repository (or any of the parent directories): .git
- git远程库与本地联系报错:fatal: Not a git repository (or any of the parent directories): .git
- Cadence 中A pin with name ‘GND' is duplicated on the part 报错的解决
- 31 Which of the following is a benefit of ASM fast disk resync? A. Failed disks are taken offline im
- 程序员面试金典: 9.2链表 2.7检查链表是否为回文
- 获取接口调用者的包名
- fcn import vgg16 weights error
- UVa 10828 Back to Kernighan-Ritchie (高斯-约当消元)
- Collection遍历输出
- 开发中遇到的报错-Setting the parent of a transform which resides in a prefab is disabled
- js 列宽根据内容自适应
- btrace使用
- SSL JudgeOnlie 2324——细胞问题
- LintCode44:最小子数组
- Redis集群搭建1
- 新零售袭来,打造极致体验的乐语能否笑傲江湖?
- 【Python那些事儿】Python中的迭代器
- 清理C盘垃圾命令