public void ClearAllChild(Transform t)
{
Transform[] childs = new Transform[t.childCount];
for (int i = 0; i < childs.Length; i++)
{
childs[i] = t.GetChild(i);
}
for (int i = 0; i < childs.Length; i++)
{
childs[i].parent = null;
UnityEngine.Object.Destroy(childs[i].gameObject);
}
}
一帧之内删除所有子级
最新推荐文章于 2023-12-12 22:07:21 发布