Author Topic: Tween sequence group  (Read 5768 times)

viqtor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Tween sequence group
« 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween sequence group
« Reply #1 on: May 17, 2014, 06:01:08 PM »

viqtor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Tween sequence group
« Reply #2 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween sequence group
« Reply #3 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.

viqtor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Tween sequence group
« Reply #4 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween sequence group
« Reply #5 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.