Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by noelrocha · Nov 20, 2011 at 04:50 PM · guilistdisableelements

How to get a list of all the GUI elements in a scene?

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image noelrocha · Nov 20, 2011 at 09:26 PM 0
Share

Thats what Im trying to find. Some documentation about this possible list. :(

avatar image jahroy · Nov 20, 2011 at 09:30 PM 0
Share

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.

avatar image noelrocha · Nov 20, 2011 at 09:34 PM 0
Share

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.

avatar image jahroy · Nov 20, 2011 at 10:49 PM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges