- Home /
How does one access the Hierarchy Window?
I'm setting the HideFlags of certain GameObjects to HideInHierarchy, however, in order to refresh it, I have to create a game object and delete it from the hierarchy. I need to be able to refresh it (repaint) via script. Has anyone gotten access to it?
Thanks ahead of time.
Answer by yoyo · Apr 12, 2011 at 05:31 AM
Two ideas, both untested ...
- You could use EditorApplication.ExecuteMenuItem to invoke "Window/Hierarchy", maybe that would trigger a refresh?
- Or perhaps EditorGUIUtility.PingObject would help?
Dang, good calls. But calling executemenuitem was did not refresh the hierarchy for me, neither did clicking on the actual menu item X p. The Ping Object on the other hand, I wish I could use if only I could get a reference to the hierarchy window. But all in all, excellent ideas.
Sigh, I tried. I guess pinging the game object you deleted isn't sufficient to refresh the view?
Heh, just tried. Negative X p. Good thought too. But I'm sure there's a way to access that hierarchy as someone was able to use reflection on it to find undocumented, read-only values such as the foldout variables for the GameObjects being displayed in it. When I get my hands on that Hierarchy window, I'm going to Ping it so hard X p.
Your answer
Follow this Question
Related Questions
Check if game object is active in hierarchy from a prefab 2 Answers
Select and Edit Animtion in Animation Window when Animator has 100+ animations 1 Answer
How do I make GUI buttons draw more GUI objects when clicked? 2 Answers
Repaint a system Editor window 1 Answer
Highlighting / Focusing on an Editor Window Through Code 1 Answer