Hello Guest

Author Topic: tk2dSpriteAnimator.PlayFrom and AnimationCompleted Event  (Read 3764 times)

bmyu1

  • Newbie
  • *
  • Posts: 1
    • View Profile
tk2dSpriteAnimator.PlayFrom and AnimationCompleted Event
« 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;
               }
« Last Edit: March 23, 2017, 11:31:12 am by bmyu1 »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dSpriteAnimator.PlayFrom and AnimationCompleted Event
« Reply #1 on: March 26, 2017, 11:11:13 pm »
Good catch. Thanks, will fix this.