场景中 克隆生成的物体 ,为 在PoolManager 的 池子中的物体的子物体。

编辑器中退出Player模式后,报错。

目前没有什么办法解决这个报错。

Can't destroy Transform component of ''. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.

在退出应用之前 destory克隆物体,但是还是报错。

...#region 退出 应用/// <summary>/// 当 退出应用的时候/// </summary>void OnApplicationQuit(){Debug.Log("Application ending after " + Time.time + " seconds");destoryAllChild(trans001);}//private void destoryAllChild(Transform trans){print("destoryAllChild");if (trans != null&& trans.childCount > 0){print(trans.name + "///"+ trans.childCount);for (int i=0;i < trans.childCount; i++){GameObject go = trans.GetChild(0).gameObject;print(i+"   "+ go.name);DestroyImmediate(go);//DestroyImmediateif (go != null){//print(" dont destory ");}}}//}//#endregion//退出 应用
...

MonoBehaviour.OnApplicationQuit()

[Unity]Can‘t destroy Transform component of ‘‘相关推荐

  1. Unity中关于Destroy的API

    Unity中关于Destroy的API 常用的关于Destory的API: //销毁游戏物体 Destroy (gameObject); //从游戏物体删除该脚本 Destroy (this); // ...

  2. Unity基础知识、Transform类

    Transform类 1)本类中的属性 -parent: 获取当前游戏对象的父对象的Transform Transform fourTrans = transform.parent; transfor ...

  3. 关于Unity中RectTransform和Transform

    以前一直以为在Inspector面板上的是Transform,后来才发现原来2D是RectTransform,3D是Transform 3D面板上显示的是位置坐标组件Transform,2D面板上显示 ...

  4. Unity中使用Destroy删除游戏物体的大坑

    以前使用Destroy删除游戏物体,删了就删了,也没有使用过DestroyImmediate来删除游戏物体 今天使用Destroy却碰到了一个坑,故顺便记录一下 在文章开始前,我们有必要区分一下使用D ...

  5. u3d5第一人称射击游戏(C#脚本)完整版并在iOS9.3系统上真机运行

    参考资料:<Unity3D\2D手机游戏开发>(第二版) +   百度 涉及U3D的功能有:摄像机控制.物理.动画.智能寻路等. 开发工具:Unity3D5.3.4,VS2015,VMpl ...

  6. Unity 2D教程: 滚动,场景和音效

    http://www.tairan.com/archives/7074 原文地址:http://www.raywenderlich.com/71029/unity-4-3-2d-tutorial-sc ...

  7. unity入门API————最常用的基类总结

    unity入门API----最常用的基类总结 前言 学校的一个大创项目要用到unity,所以小学一下.但是unity这个体量似乎有点太大了吧-在书店淘了一本张尧写的<Unity3D从入门到实战& ...

  8. Unity 3.Adventure Game tutorial(事件系统、动画状态机、库存、条件、反应、交互、游戏状态)

    双语机翻视频: https://www.bilibili.com/video/av34383045/ 在官网asset Store下载了完整工程,和pdf asset Store:https://as ...

  9. Unity 之 DontDestroyOnLoad的使用

    Unity中的一个方法DontDestroyOnLoad可以让某些游戏对象在切换场景的时候不是释放,听上去很好用的方法, 了解一下官方文档: public static void DontDestro ...

最新文章

  1. 设备物理像素、设备独立像素
  2. Python使用matplotlib可视化时间序列堆叠的面积图、堆叠面积图给出了多个时间序列的贡献程度的可视化表示,以便于相互比较(Stacked Area Chart)
  3. Pandas将dataframe保存为pickle文件并加载保存后的pickle文件查看dataframe数据实战
  4. RC隔离级别下的GAP间隙锁
  5. Linux下的xml文件的创建
  6. word中的表格空白部分整不掉,下面的表格拉不上来
  7. javascript:使用canvas绘图2D图形
  8. Oracle 19c和20c新特性最全解密
  9. java 爬虫 图片_java实现爬虫爬取小姐姐图片
  10. 使用PowerShell SQL Server DBATools的IDENTITY列阈值
  11. ol3 Demo1 ----加载geoserver发布的地图数据
  12. 核心网upf作用_5G核心网关键技术研究
  13. mysql-connector-java-8.0.26.jar MySQLJDBC下载
  14. GPRS通信原理+中国移动micro sim 卡,实现经过tcp/ip 传输数据到服务器
  15. 《数据中台架构:企业数据化最佳实践》:感受数据中台建设五步法
  16. LAMP基础环境的搭建,即Linux、Apache、MySQL、PHP环境
  17. 国内下载vscode速度慢问题解决
  18. LAMP环境源码搭建
  19. @ComponentScan(“com.guigu“)爆红
  20. 计算机无法与硬盘,无法识别的硬盘原因和解决方法[详细]

热门文章

  1. QObject: Cannot create children for a parent that is in a different thread
  2. MongoDB Windows环境备份和还原
  3. Linux下MongoDB自动备份
  4. 物流app模板html,我的物流.html
  5. java字符串转化非acc,如何理解Keras模型拟合中的损失acc val_loss val_acc
  6. laravel-admin密码加密
  7. 日均2亿PV网站架构
  8. [MRCTF2020]你能看懂音符吗
  9. redis实现抢红包功能
  10. linux 内核学习2-使用笨叔叔定制的内核