I have found that FindObjectOfType will return all kinds of weird things that are not in the scene. "activeInHeirachy" solves the problem:
object[] allObjects = FindObjectsOfTypeAll(typeof(GameObject)) ;
foreach(object thisObject in allObjects)
if (((GameObject) thisObject).activeInHierarchy)
print(thisObject+" is an active object") ;
↧