c# unity check if gameobject has child
// 1
if(transform.childCount > 0) //do something
// 2
for (var child : Transform in transform) {
// do whatever you want with each child transform here
}
// 3
for(var i : int = 0; i < transform.childCount; i++) {
var child : Transform = transform[i];
// do whatever you want with each child transform here
}
// 4
for(var something : Thing in somethingElse) {
// do whatever you want with each something here
}
// 5
for(var i : int = 0; i < somethingElse.length; i++) {
var something : Thing = somethingElse[i];
// do whatever you want with each something here
}