|
I would like to know how to get a list of all the GUI elements in a scene and disable them (make them invisible). Thanks in advance
(comments are locked)
|
|
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. :(
Nov 20 '11 at 09:26 PM
noelrocha
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.
Nov 20 '11 at 09:30 PM
jahroy
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.
Nov 20 '11 at 09:34 PM
noelrocha
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. Maybe you could draw something of your own over the button as a workaround.
Nov 20 '11 at 10:49 PM
jahroy
(comments are locked)
|
