pixijs/spine

How to end animation loop on next loop iteration finish?

mm12312 opened this issue · 1 comments

Hi, I want to mark an animation loop as ready for finish in in the next iteration after an event and wanted to ask how to do that.

What I've tried:

this.spine.state.setAnimation(trackIndex, animationName, true)

// after event happens:
const trackEntry = this.spine.state.getCurrent(trackIndex)
trackEntry.loop = false

It turned out that setting loop to false immediately ends the animation instead of letting it run till its end.

This seems to solve the issue

this.spine.state.addEmptyAnimation(trackIndex)