mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Better delay adjustment.
This commit is contained in:
parent
c25809fa4f
commit
3a1aac897c
@ -201,9 +201,10 @@ public class AnimationState {
|
||||
_tracks[trackIndex] = entry;
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last)
|
||||
delay += Math.max(0, last.endTime - last.time) - _data.getMix(last.animation, animation);
|
||||
else
|
||||
if (last) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= _data.getMix(last.animation, animation);
|
||||
} else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -266,10 +266,8 @@ spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIn
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last) {
|
||||
float remaining = last->endTime - last->time;
|
||||
if (remaining < 0) remaining = 0;
|
||||
delay += remaining;
|
||||
if (animation) delay -= spAnimationStateData_getMix(self->data, last->animation, animation);
|
||||
if (last->time < last->endTime) delay += last->endTime - last->time;
|
||||
delay -= spAnimationStateData_getMix(self->data, last->animation, animation);
|
||||
} else
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
@ -213,9 +213,10 @@ namespace Spine {
|
||||
tracks[trackIndex] = entry;
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last != null)
|
||||
delay += Math.Max(0, last.endTime - last.time) - data.GetMix(last.animation, animation);
|
||||
else
|
||||
if (last != null) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= data.GetMix(last.animation, animation);
|
||||
} else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -1109,9 +1109,10 @@ spine.AnimationState.prototype = {
|
||||
this.tracks[trackIndex] = entry;
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last)
|
||||
delay += last.endTime - this.data.getMix(last.animation, animation);
|
||||
else
|
||||
if (last) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= this.data.getMix(last.animation, animation);
|
||||
} else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -232,9 +232,10 @@ public class AnimationState {
|
||||
tracks.set(trackIndex, entry);
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last != null)
|
||||
delay += Math.max(0, last.endTime - last.time) - data.getMix(last.animation, animation);
|
||||
else
|
||||
if (last != null) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= data.getMix(last.animation, animation);
|
||||
} else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -201,9 +201,8 @@ function AnimationState.new (data)
|
||||
delay = delay or 0
|
||||
if delay <= 0 then
|
||||
if last then
|
||||
local remaining = last.endTime - last.time
|
||||
if remaining < 0 then remaining = 0 end
|
||||
delay = delay + remaining - self.data:getMix(last.animation.name, animation.name)
|
||||
if last.time < last.endTime then delay = delay + last.endTime - last.time end
|
||||
delay = delay - self.data:getMix(last.animation.name, animation.name)
|
||||
else
|
||||
delay = 0
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user