NGUI查找子节点下的所有组件并且循环遍历销毁

来源:互联网 发布:淘宝体验中心 编辑:程序博客网 时间:2024/06/09 21:43
function OnDisable() {
switch(this.name){
case "UIGrid"://用于标识父节点
for(var i:int = 0;i<this.transform.childCount;i++)//遍历子节点
{
Destroy(this.transform.GetChild(i).gameObject);//销毁子节点数据
}
break;
}
}
0 0
原创粉丝点击