Foreach statement - Transform myvar in transform

Hi AJMeyer,

Unfortunately, that’s Unity’s big secret. And since most parts of Unity are not open-source, so we often do not know what is going on behind the scenes. That is also the case here.

We know about this “children” feature because of the description in the API: “They also support enumerators so you can loop through children using”.

In the Transform class, there is very likely something implemented like this:
https://www.dotnetperls.com/ienumerable


See also: