Skip to content

PlySprite: fix scrub so that callbacks are triggered #50

@projectitis

Description

@projectitis

Currently scrub will fire callbacks, but not all of them under all conditions.
For example:

  • If the animation is not yet playing
  • And scrub is called
  • Then onAnimationStart will not be called on the first animation in the queue

Note that when this is fixed take care for callbacks not to happen multiple times. The following code could cause it to be triggered twice:

final anim = Anim();
anim.play("Walk"); // Triggers onStart
anim.scrub(0.7); // Since time hasn't progressed, might trigger on start again

onStart should probably be triggered in scrub, not in play or _playNext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions