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 Seth-Bergman · Aug 06, 2012 at 04:53 AM · guibutton

How do I reset GUI Button to normal state texture(Android)?

Hey all, simple question here I can't quite seem to find the answer to:

edit: (This only happens on the Android build)

Currently, I have a series of simple gui buttons for my menu, which use a GUI skin with separate textures for "normal" and "active" states. The problem is that when I reopen the scene after playing the next level, the last button which was pressed still remains in the "active" state. Yes, I realize there are plenty of simple ways to get around this (I will probably just switch out the GUI skin, rather than use the "active" and "normal" as separate textures, since I can reset that on awake..). But is there a way to reset the button state somehow through code? Been wondering about this for awhile, but SOMEHOW I've never managed to find the answer yet..

Thanks for your time!

Edit:

to open I simply call Application.LoadLevel(5);

the button is just normal isolated button:

 function OnGUI(){
 
 if(GUI.Button(Rect((Screen.width / 2) - 115,Screen.height-140,230,150),"PLAY!") || Input.GetKey("return"))
 {
 if(level > 0)
 loadScreenScript.Load(2);
 else
 loadScreenScript.Load(3);
 
 }
 
 }

forgot to mention also, it's Android build, I think that's a key piece of info, oops!

and now that I check, it ONLY happens on the android build .. updating ...

Comment
Add comment · Show 2
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 Bluk · Aug 06, 2012 at 11:29 AM 0
Share

How do you open your scene? I think what you propose is probably the easiest way to work around that, resetting the GUI when you reload the scene. However it is a weird problem, i've done similar things and didn't encounter such problem. So I'm interested :)

avatar image VicM · Nov 29, 2012 at 02:32 AM 0
Share

Same problem and behaviour here. Any update? I am still searching for a solution.

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to WaitforSeconds a GuiButton ? 0 Answers

How can I make a gui with buttons pop up in javasript? 1 Answer

Check if GUI is Pressed 1 Answer

Infinite GUI Button positions. 3 Answers

Making a Hover function for a button or toolbar from code. 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