2D Toolkit Forum
2D Toolkit => Support => Topic started by: bmyu1 on March 23, 2017, 09:33:56 am
-
tk2dSpriteAnimator.PlayFrom(larger time than animation time) should fire AnimationCompleted Event immediately, but the event never happen.
tk2dSpriteAnimator.cs
// clipStartTime is in seconds
// clipTime is in clip local time (ignoring fps)
float time = clipStartTime * clipFps;
if (currentClip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Once && time >= clipFps * currentClip.frames.Length)
{
// warp to last frame
WarpClipToLocalTime(currentClip, currentClip.frames.Length - 1);
OnAnimationCompleted(); <<<< This line should be added.
state &= ~State.Playing;
}
-
Good catch. Thanks, will fix this.