unity删除父物体下所有子物体对象

GameObject father = GameObject.Find("CollidGroup");
int childCount = father.transform.childCount;
for (int i = 0; i < childCount; i++){
  Object.Destroy(father.transform.GetChild(i).gameObject);
}
原文地址:https://www.cnblogs.com/codeit/p/15502427.html