Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Sahkan on January 17, 2016, 08:31:58 AM

Title: How do I totally reset a tween when it is in PingPong style?
Post by: Sahkan on January 17, 2016, 08:31:58 AM
I'm using this code to restart a tween every time I play it, It works great for Style.Once.

  1.         tweenPosition_.from = transform.localPosition;
  2.         tweenPosition_.ResetToBeginning();
  3.         tweenPosition_.to = destination;
  4.         tweenPosition_.PlayForward();

But when I use Style.PingPong, It will will reset the animation but from the last starting point.
It means that if it started the "pong" animation, It will restart it from that "pong" and not from the "ping" state ( from the end instead of the beginning ).
How can I totally reset it?
Title: Re: How do I totally reset a tween when it is in PingPong style?
Post by: ArenMook on January 20, 2016, 08:23:39 AM
Change the tweenFactor to 0.