Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Huacanacha

Pages: [1]
1
NGUI 3 Documentation / Re: UIToggle
« on: June 12, 2014, 02:53:48 AM »
Ok.  I've reverted to this method.  I'd much rather not modify code unless absolutely necessary.

It does seem counter-intuitive to me that a toggle has side effects.  Wouldn't turning the game object on/off be a much cleaner way to achieve this?

2
NGUI 3 Documentation / Re: UIToggle
« on: June 11, 2014, 04:36:21 PM »
I had a problem with this script overriding the alpha of the activeSprite.  My 'on' state sprite had about 60% alpha but UIToggle would always set it to a glaring 100% opacity.  Here's my solution... I recommend adding something like this in an NGUI update.

1. Add a float targetAlpha field.

2. Put this first thing in Start()
  1. if (activeSprite != null) {
  2.         targetAlpha = activeSprite.color.a;
  3. }

3. Replace the 3-4 instances of "1f" with targetAlpha

Enjoy!

Pages: [1]