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