Support => NGUI 3 Support => Topic started by: rockafnan on February 13, 2013, 01:43:22 AM
Title: Different tween for forward and reverse Play direction
Post by: rockafnan on February 13, 2013, 01:43:22 AM
Hi, I'm new to NGUI. Is there any way to have different tween on a window for forward and reverse direction? e.g. for forward I want my window to have scale tween but as a reverse I want it to fade out.
Title: Re: Different tween for forward and reverse Play direction
Post by: ArenMook on February 13, 2013, 01:44:04 PM
Set up different tweens, give them different group IDs, and activate the correct tween.
Title: Re: Different tween for forward and reverse Play direction
Post by: nice_C_nice on March 02, 2013, 05:33:40 AM
New to Unity and NGUI. Awesome Job!
Can you please give a snippet on how to use tween group in code? In other words, how do I get a tween with a certain group number?
Title: Re: Different tween for forward and reverse Play direction
Post by: ArenMook on March 02, 2013, 11:11:36 AM
The groups are mainly for automatic activation of tweens, seeing as you can be selective via code anyway. But if you wanted to check what group tweens belong to and only activate specific ones, you could do something like this:
UITweener[] tweens = GetComponents<UITweener>();
foreach(UITweener tw in tweens){if(tw.tweenGroup==123) tw.Play(true);}
Title: Re: Different tween for forward and reverse Play direction
Post by: nice_C_nice on March 03, 2013, 11:52:48 PM
Ok thanks. That's exactly what I had already. I had two TweenColors on a GO and thought for sure there was a better way to just grab a specific one rather than littering the code with "foreach" everywhere. Especially since i only had two. Alas I'm still new to C# and Unity.
Appreciate you taking the time to respond. Thank you.
Title: Re: Different tween for forward and reverse Play direction
Post by: rockafnan on March 05, 2013, 02:09:59 AM