Support => NGUI 3 Support => Topic started by: konohira on June 27, 2012, 05:12:58 AM
Title: Tween Restart Problem
Post by: konohira on June 27, 2012, 05:12:58 AM
Hi Aren,
I want to restart tween animation. For that purpose, I write following codes.
sprite.gameObject.SendMessage("Play", true);
sprite.gameObject.SendMessage("Reset");
But, a problem occurred. Delay don't work of the second playing. Delay is initalized by following code (in UITweener.cs)
void Start ()
{
mStartTime = Time.realtimeSinceStartup+ delay;
Update();
}
"mStartTime" is not initialized with delay in second play. Because, Start() is called only once. Please fix this problem. Sorry for my poor English. Thanks.
Title: Re: Tween Restart Problem
Post by: ArenMook on June 27, 2012, 06:54:14 AM
I originally thought the delay will only be used by people adding scripts in the inspector... seems I was wrong. :)
I'll fix it, thanks.
Title: Re: Tween Restart Problem
Post by: themipper on May 03, 2013, 06:31:25 PM
Hello ArenMook,
It seems that this is not fixed in the current Version 2.5.1.
I fixed it by adding mStarted = false to the UITweener.Reset() method.