Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: viqtor on May 17, 2014, 04:19:53 AM

Title: Tween sequence group
Post by: viqtor on May 17, 2014, 04:19:53 AM
Hello,

I have 2 or more tweens on the same sprite, how can I play a specific tween on onFinished from another one. Even if I set the group tween some value and play it with UIPlayTween, I'll end up with more UIPlayTween scripts on the same object, which is not a solution either.
The most simple solution I can think of is to have an array on each Tween with tween groups that will play when the tween is finished.
This is very important for my graphic team, so they don't need to write any code to make animations.

Thanks
Title: Re: Tween sequence group
Post by: ArenMook on May 17, 2014, 06:01:08 PM
http://youtu.be/jDxWG81sNPc?t=15m49s
Title: Re: Tween sequence group
Post by: viqtor on May 19, 2014, 12:26:31 AM
In your example the sprite had 2 separate tweens: UITweenHeight, and UITweenWidth. But what do I do if I have the same tween 2 or more times? How do I know which one to call?
Title: Re: Tween sequence group
Post by: ArenMook on May 19, 2014, 12:38:32 PM
You can't tell for sure. Same as if you had 2 of the same component on a game object and you tried to determine which is which via GetComponents. This is why you should place things on separate game objects.
Title: Re: Tween sequence group
Post by: viqtor on May 20, 2014, 06:19:15 AM
You could tell if you can give names to your tweens and play a specific tween based on that name. Or based on their Tween Group, if you prefer that way. Can this be done, or do I have to do it myself?
Title: Re: Tween sequence group
Post by: ArenMook on May 20, 2014, 02:06:38 PM
You can specify a group on the tweens, but the delegate/property binding approach is generic and doesn't know anything about specifics of scripts, so it wouldn't make sense for it to check the group ID. Using different game objects is still the best approach here.