Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Paul5 on July 17, 2014, 06:02:07 PM

Title: UIToggle Question
Post by: Paul5 on July 17, 2014, 06:02:07 PM
I have a series of radio buttons that when active need to change their sprite. The standard UI toggle won't work as the sprites have a transparency effect, therefore I can't simply hide it behind the other sprite. I've tried writing a script that changes the sprites when a new radio button is selected. Unfortunately, the sprites don't seem to update unless I mouse over them. What is the best way to handle this situation?

Thanks
Title: Re: UIToggle Question
Post by: ArenMook on July 18, 2014, 06:16:34 AM
What are you actually doing in your script when you change the sprites? Why do you need to mouse over for the sprite to update? If you're using a button there, remember that you need to change UIButton's normalSprite (via the property), not the sprite it's using.
Title: Re: UIToggle Question
Post by: Paul5 on July 18, 2014, 12:50:17 PM
Edit: I was able to solve this problem about ten minutes ago. It turns out that, in fact, this had nothing at all to do with NGUI. Apparently unity wasn't getting all the objects in the update function, so it was producing strange results. Instead I used the awake function and the inspector to gather all of the objects I needed.

Thanks!