标签:unity3d
for (int i = 0; i < rewardGrid.transform.childCount; i++) { GameObject it = rewardGrid.transform.GetChild(i).gameObject; it.transform.parent = null; Destroy ( it ); }
或者
while (grid.transform.childCount > 0) { DestroyImmediate(grid.transform.GetChild(0).gameObject); }
标签:unity3d
原文地址:http://blog.csdn.net/yuxikuo_1/article/details/45154943