GameObject parentObj = GameObject.FindGameObjectWithTag ("MySence");
for (int i = 0; i < parentObj.transform.childCount; i++) {
Destroy (parentObj.transform.GetChild (i).gameObject);
}
unity 找到当前物体下的所有物体
最新推荐文章于 2024-05-28 16:42:42 发布
GameObject parentObj = GameObject.FindGameObjectWithTag ("MySence");
for (int i = 0; i < parentObj.transform.childCount; i++) {
Destroy (parentObj.transform.GetChild (i).gameObject);
}