while (randomGeneration.transform.childCount != 0)
{
DestroyImmediate(randomGeneration.transform.GetChild(0).gameObject);
}
這樣他只要子物體有東西他就刪,直到為0
while (randomGeneration.transform.childCount != 0)
{
DestroyImmediate(randomGeneration.transform.GetChild(0).gameObject);
}
這樣他只要子物體有東西他就刪,直到為0