|
Hey Unity folks! As the title implies I would like to find all root transforms in the scene hierarchy, via a C# script. Here's the catch: There are a lot of children for each transform. So far the methods we've found are:
Is there a more elegant way of finding all root transforms in the scene hierarchy?
(comments are locked)
|
|
no of course there is no way to quickly search thousands of things for a few specific things. However its worth asking yourself how these objects get generated to begin with. If these roots are really important to you you have a few choices.
keep in mind even if the parents are changing its probably less costly to mess with a small array that search a large scene.
(comments are locked)
|

I really want to know this also. Especially when the GameObjects are inactive, we can't normally find them. How can we traverse through thousands of GOs just to find several root GameObject ? I know that Resource.FindObjectsOfTypeAll should do the trick but it's terribly slow, why should I search the whole project just to find several root scene object ? Anyone have a better idea ?