- Home /
Answer by jahroy · Nov 20, 2011 at 09:12 PM
You can make all GUI controls invisible by not drawing them.
This can be done using a boolean to track whether or not the GUI should be drawn. If it is false, have your scripts either exit the OnGUI function immediately or not draw certain controls.
I'm not sure there is a way to get a list of all the GUI controls in a scene. I'm don't know if that makes sense given the way Unity approaches its GUI system. Based on the way the controls are drawn from frame to frame, I'm not sure a list of this kind is maintained.
That being said, the state of Toggle buttons is obviously mainained, so maybe there is such a list. If there is such a thing, it should be in the documentation somewhere.
Thats what Im trying to find. Some documentation about this possible list. :(
I don't believe it exists.
Since each control is drawn explicity by you, the programmer, it's probably up to you to build and maintain this list as you draw them.
It's not like you create them and give them names. They're drawn BY YOU every frame.
I'm using a third part plugin. In that plugin, there is a info button that calls another scene that you put informations about your game. But my client doesn't want to create a new scene to include informations about the game in this way. So I want to make this button invisible. Thats why I want to get a list of the GUI elements and disable this one.
No clue how to deal with this mysterious plugin of yours...
Ideally you can look at and/or alter its source code. If not you may be out of luck.
$$anonymous$$aybe you could draw something of your own over the button as a workaround.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
GUI.Window write elements by pages 0 Answers
Having trouble moving item from one list to another! 1 Answer
Changes not being saved in the Inspector Editor 1 Answer
Hide GUI while switchcam 3 Answers