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 T. · Jan 13, 2011 at 03:03 AM · javascriptguiongui

turn off items from GUI

I have a GUI made up of a large number of buttons, pressing each button calls a function that affects the scene in some way (showing an object, showing images .etc), everything works fine and I can hide the objects when I push the buttons again .etc

what I really need to be able to do is run the hide function when I push a different button (to prevent everything overlapping and killing the performance). I've tried creating a function that calls the 'off' for each button but this caused some problems (everything assumed it was off and nothing worked)

does anyone have any opinions of how I could get this to work?

thanks

heres some example code:

function onGUI () { button showObject (boolean) button showImage (boolean) }

showObject { if (boolean) { do what it is supposed to enable a 2nd script (has more menu controls .etc) } else { hide the object disable the script } }

showImage { same as showObject }

basically, each function enables/disables its contents based on a boolean i send in (i.e true if it is on (so we are disabling it), false if it off (so we are enabling it).

Comment
Add comment · Show 3
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 yoyo · Jan 13, 2011 at 04:02 AM 3
Share

Please include some of your code (format it with the little 1001 button for easy reading) and we'll try to help.

avatar image DaveA · Jan 13, 2011 at 08:49 PM 0
Share

Is this Boo or Javascript or pseudocode? I would not use 'boolean' as a variable name.

avatar image T. · Jan 14, 2011 at 11:44 PM 0
Share

javascript/pseudoce. boolean isn't the variable name, just what is being checked.

0 Replies

· Add your reply
  • Sort: 

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

No one has followed this question yet.

Related Questions

using GUI scrollView for multiple onGUI functions 0 Answers

GUI opacity. 1 Answer

Setting Scroll View Width GUILayout 1 Answer

GUI Not updating 1 Answer

GUI.Window only shows for one frame under all circumstances 2 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