Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: DEngland on January 20, 2015, 07:12:34 PM

Title: Any way to have a UIButton without the tween?
Post by: DEngland on January 20, 2015, 07:12:34 PM
UIButtonColor is a neat feature, but it's really frustrating that every UIButton must have one and it's even worse that there doesn't seem to be a way to turn them off. Most mobile projects aren't going to need it as there's no hover on touch devices anyway. It can be made invisible by turning all the colours to white but you still have the unnecessary overhead and even then the tint is still being applied on hover etc. which means if you want to manually tint the sprite with your own code then your changes get wiped out. You can try setting the tween target to None but UIButtonColor will re-acquire its own GameObject at runtime.

I'm all for user-friendliness but this is just obnoxious. I found a user post suggesting that commenting out the line "mWidget = tweenTarget.GetComponent<UIWidget>();" in the UIButtonColor constructor allows him to disable the feature by setting the tween target to null, but I'd prefer not to customize the NGUI classes.

Is there really no way to have a button that doesn't presume to animate itself? I could move all sprites to a different GameObject but that's awkward.
Could we please get a checkbox on UIBUtton (defaulting to off) so that UIButtonColor is only present when it is desired?

Any help is appreciated.
Title: Re: Any way to have a UIButton without the tween?
Post by: ArenMook on January 20, 2015, 10:29:44 PM
If you need only parts of the functionality, then why not make a simple custom button class instead with only the functionality that you need? It would be much cleaner.