mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
When delay is <= 0 use remaining time, not just duration.
http://www.esotericsoftware.com/forum/viewtopic.php?f=7&t=1447
This commit is contained in:
parent
f08d9b817c
commit
c25809fa4f
@ -202,7 +202,7 @@ public class AnimationState {
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last)
|
||||
delay += last.endTime - _data.getMix(last.animation, animation);
|
||||
delay += Math.max(0, last.endTime - last.time) - _data.getMix(last.animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
@ -266,7 +266,9 @@ spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIn
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last) {
|
||||
delay += last->endTime;
|
||||
float remaining = last->endTime - last->time;
|
||||
if (remaining < 0) remaining = 0;
|
||||
delay += remaining;
|
||||
if (animation) delay -= spAnimationStateData_getMix(self->data, last->animation, animation);
|
||||
} else
|
||||
delay = 0;
|
||||
|
||||
@ -214,7 +214,7 @@ namespace Spine {
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last != null)
|
||||
delay += last.endTime - data.GetMix(last.animation, animation);
|
||||
delay += Math.Max(0, last.endTime - last.time) - data.GetMix(last.animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ public class AnimationState {
|
||||
|
||||
if (delay <= 0) {
|
||||
if (last != null)
|
||||
delay += last.endTime - data.getMix(last.animation, animation);
|
||||
delay += Math.max(0, last.endTime - last.time) - data.getMix(last.animation, animation);
|
||||
else
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
@ -201,7 +201,9 @@ function AnimationState.new (data)
|
||||
delay = delay or 0
|
||||
if delay <= 0 then
|
||||
if last then
|
||||
delay = delay + last.endTime - self.data:getMix(last.animation.name, animation.name)
|
||||
local remaining = last.endTime - last.time
|
||||
if remaining < 0 then remaining = 0 end
|
||||
delay = delay + remaining - self.data:getMix(last.animation.name, animation.name)
|
||||
else
|
||||
delay = 0
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user