这有点违反直觉,但它按预期工作。 仅当不再应用动画时才会触发动画结束事件。 但是,即使在非循环动画的情况下,动画的最后一帧也将无限期地应用,直到通过排队新动画将动画从轨道“删除”。
您可以通过将“AddAnimation”节点返回的轨道条目的“trackEnd”值设置为动画持续时间来更改此行为。
http://en.esotericsoftware.com/spine-api-reference#TrackEntry-trackEnd
This is a little counter intuitive, but it works as intended. The animation end event is only triggered if the animation is no longer applied. However, even in case of an un-looped animation, the animation's last frame will be applied indefinitely until the animation is "removed" from the track by queueing a new animation.
You can change this behaviour by setting the trackEnd
value of the track entry returned by the AddAnimation
node to the animation duration.
http://en.esotericsoftware.com/spine-api-reference#TrackEntry-trackEnd