mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[lua] Ported 0 timeScale fix, see #1194.
This commit is contained in:
parent
0e2c41b491
commit
03e578642c
@ -299,7 +299,7 @@ function AnimationState:updateMixingFrom (to, delta)
|
|||||||
from.trackLast = from.nextTrackLast
|
from.trackLast = from.nextTrackLast
|
||||||
|
|
||||||
-- Require mixTime > 0 to ensure the mixing from entry was applied at least once.
|
-- Require mixTime > 0 to ensure the mixing from entry was applied at least once.
|
||||||
if (to.mixTime > 0 and (to.mixTime >= to.mixDuration or to.timeScale == 0)) then
|
if (to.mixTime > 0 and to.mixTime >= to.mixDuration) then
|
||||||
-- Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
|
-- Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
|
||||||
if (from.totalAlpha == 0 or to.mixDuration == 0) then
|
if (from.totalAlpha == 0 or to.mixDuration == 0) then
|
||||||
to.mixingFrom = from.mixingFrom
|
to.mixingFrom = from.mixingFrom
|
||||||
@ -310,6 +310,13 @@ function AnimationState:updateMixingFrom (to, delta)
|
|||||||
return finished
|
return finished
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
|
||||||
|
if to.timeScale == 0 and to.mixingTo then
|
||||||
|
to.timeScale = 1
|
||||||
|
to.mixTime = 0
|
||||||
|
to.mixDuration = 0
|
||||||
|
end
|
||||||
|
|
||||||
from.trackTime = from.trackTime + delta * from.timeScale
|
from.trackTime = from.trackTime + delta * from.timeScale
|
||||||
to.mixTime = to.mixTime + delta * to.timeScale
|
to.mixTime = to.mixTime + delta * to.timeScale
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user