Author Topic: How to ResetToBeginning using UIPlayTween?  (Read 5213 times)

bigproblem01

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
How to ResetToBeginning using UIPlayTween?
« on: October 13, 2014, 06:30:18 AM »
Hi,

Can you please tell me how to use ResetToBeginning on all the tweens that are on one game object? I know there's a ResetToBeginning when dealing with an individual tween but how do I do this through UIPlayTween so that I can reset tweens selectively that are on one game object?
Is what I'm looking for ResetIfDisabled? I don't quite understand the explanation "Whether the tween will be reset to the start if it's disabled when activated."

Thanks

P.S. GetComponent<UIPlayTween>().Play(false); <--- is it right to use this to PlayReverse or it's better to change the play direction to reverse and play it with Play(true)?
« Last Edit: October 13, 2014, 07:44:22 AM by bigproblem01 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to ResetToBeginning using UIPlayTween?
« Reply #1 on: October 14, 2014, 01:30:31 PM »
Reset tweens selectively? Selective anything would imply using groups on tweens, but I'm not sure if I understand your question fully, because you start your post talking about all tweens, not being selective. Easiest thing to do is to give your tweens a group ID, and use the same group on the UIPlayTween.

bigproblem01

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: How to ResetToBeginning using UIPlayTween?
« Reply #2 on: October 15, 2014, 07:17:17 AM »
I'm using groups of course. My situation is the following:
I have a game object which has four tweens on it, grouped 0,1,2,3.
I want to reset tween 0 and tween 2 to the beginning at a certain time.
If I had just one tween on that game object, I'd use GetComponent<TweenScale>().ResetToBeginning();
But since I have four difference tweens and out of those four I want to reset only two I can't use ResetToBeginning, so my question is, how do I reset them?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to ResetToBeginning using UIPlayTween?
« Reply #3 on: October 16, 2014, 06:21:13 AM »
UITweener[] tweens = GetComponents<UITweener>();
foreach (UITweener tw in tweens) tw.ResetToBeginning();

bigproblem01

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: How to ResetToBeginning using UIPlayTween?
« Reply #4 on: October 16, 2014, 07:41:43 AM »
ah, I was thinking in a wrong way, thought there's a UIPlayTween command for that :D
Thanks!