var tameObject:GameObject[];
function Start()
{
tameObject= FindObjectsOfType(GameObject) as GameObject[];
}
function Update()
{
for(var i:GameObject in tameObject)
{
Debug.Log(i.name);
}
}
转载于:https://www.cnblogs.com/softimagewht/archive/2011/04/02/2003812.html