mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Fixed last event being fired too many times.
This commit is contained in:
parent
08d5efa31d
commit
981e7a1371
@ -518,6 +518,8 @@ void _EventTimeline_apply (const Timeline* timeline, Skeleton* skeleton, float l
|
||||
EventTimeline* self = (EventTimeline*)timeline;
|
||||
int frameIndex;
|
||||
|
||||
if (lastTime >= self->frames[self->framesLength - 1]) return; // Last time is after last frame.
|
||||
|
||||
if (lastTime > time) {
|
||||
/* Fire events after last time for looped animations. */
|
||||
_EventTimeline_apply(timeline, skeleton, lastTime, (float)INT_MAX, firedEvents, eventCount, alpha);
|
||||
|
||||
@ -463,6 +463,8 @@ namespace Spine {
|
||||
float[] frames = this.frames;
|
||||
int frameCount = frames.Length;
|
||||
|
||||
if (lastTime >= frames[frameCount - 1]) return; // Last time is after last frame.
|
||||
|
||||
if (lastTime > time) { // Fire events after last time for looped animations.
|
||||
Apply(skeleton, lastTime, int.MaxValue, firedEvents, alpha);
|
||||
lastTime = 0;
|
||||
|
||||
@ -537,6 +537,8 @@ public class Animation {
|
||||
float[] frames = this.frames;
|
||||
int frameCount = frames.length;
|
||||
|
||||
if (lastTime >= frames[frameCount - 1]) return; // Last time is after last frame.
|
||||
|
||||
if (lastTime > time) { // Fire events after last time for looped animations.
|
||||
apply(skeleton, lastTime, Integer.MAX_VALUE, firedEvents, alpha);
|
||||
lastTime = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user