So I can get the child game object no problem using this code:
var sCount:int = 0;
for (var child : GameObject in GameObject.Find("Units"))
{
if(child.allunits.selected == true)
{
sCount++;
}
}
print(sCount);
But my problem is, my script (allunits) isn’t part of the game object class (obviously), so how do I get the static variable of selected from my children?