began to find the next u3d script book, found that this thing can not find. Then Google search "Unity3d get all child" only to find the answer. Very simple answer, but very interesting, very useful.
foreach (Transform child in Transform) { Debug.Log (child.gameObject.name);}
Transform is the transform of the object gameobject you need to find. The For loop is the equivalent of traversing its sub-object, and all you have to do is put it in the array. If you want to filter out some of the sub-objects in the loop to write a bit is OK.
Delete all child objects:
foreach (Transform child in Transform) { Destroy (child.gameobject);}
Forget when, it is not possible to delete this, but now it is possible.
2014.1.3 added: The way to traverse the delete seems to be not possible, or to store it in a list to delete one after another. It seems that some circumstances can be not, very strange.
Transferred from: http://www.360doc.com/content/16/0531/23/33879684_564041693.shtml
Unity3d get all Sub object Objects (child) of an object