Make the Game Objects behave as folders in hierarchy

I have this idea and want to ask if this is posible to do in unity.

What I want is that if I Double Click a Gameobject in the hierarchy window, it will “enter” to the game object placing in it first and only showing its children.

The parent or other Game Objects in the hierarchy are hidden outside the gameobject. If you go “back”, you see again the root where you were.

Let me show you how I think it lookslike with folders.

Here I’m looking at the inspector and I have 3 Game Objects, One of them “GUI” has two children.

alt text

If I do double click on the “GUI” gameobject, the inspector will hide the other game objects and leave me with GUI as the root

alt text

Of course there is a need of a back button. But I think you get the idea.

Is this kind of possible? I want to reduce at maximum the amount of game objects I’m seeing at the same time in the hierarchy and I think this could help. Maybe lock the other game objects to avoid modifying them if you don’t have to.

Thanks in advance.

Yes. It’s possible. You’ll just have to write a script that shows/hides game objects using some combination of transform.parent and getComponentsInChildren . If you are asking how to do that, my answer is to try something and then ask for specific help when you get stuck on a specific problem.