mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +08:00
Fixed animation state delay when not set right away.
This commit is contained in:
parent
03610fcaad
commit
a9315d46f3
@ -200,10 +200,9 @@ public class AnimationState {
|
||||
_tracks[trackIndex] = entry;
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= _data.getMix(last.animation, animation);
|
||||
} else
|
||||
if (last)
|
||||
delay += last.endTime - _data.getMix(last.animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -262,10 +262,9 @@ spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIn
|
||||
self->tracks[trackIndex] = entry;
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last) {
|
||||
if (last->time < last->endTime) delay += last->endTime - last->time;
|
||||
delay -= spAnimationStateData_getMix(self->data, last->animation, animation);
|
||||
} else
|
||||
if (last)
|
||||
delay += last->endTime - spAnimationStateData_getMix(self->data, last->animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
entry->delay = delay;
|
||||
|
||||
@ -213,10 +213,9 @@ namespace Spine {
|
||||
tracks[trackIndex] = entry;
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last != null) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= data.GetMix(last.animation, animation);
|
||||
} else
|
||||
if (last != null)
|
||||
delay += last.endTime - data.GetMix(last.animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -231,10 +231,9 @@ public class AnimationState {
|
||||
tracks.set(trackIndex, entry);
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last != null) {
|
||||
if (last.time < last.endTime) delay += last.endTime - last.time;
|
||||
delay -= data.getMix(last.animation, animation);
|
||||
} else
|
||||
if (last != null)
|
||||
delay += last.endTime - data.getMix(last.animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
entry.delay = delay;
|
||||
|
||||
@ -200,8 +200,7 @@ function AnimationState.new (data)
|
||||
delay = delay or 0
|
||||
if delay <= 0 then
|
||||
if last then
|
||||
if last.time < last.endTime then delay = delay + last.endTime - last.time end
|
||||
delay = delay - self.data:getMix(last.animation.name, animation.name)
|
||||
delay = delay + last.endTime - self.data:getMix(last.animation.name, animation.name)
|
||||
else
|
||||
delay = 0
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user