mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[ts] Port of commit f1e0f0f: Fixed animation not being mixed out in some cases. See #2786.
This commit is contained in:
parent
58f99b1c0c
commit
9ae2b732c0
@ -138,11 +138,10 @@ export class AnimationState {
|
|||||||
from.animationLast = from.nextAnimationLast;
|
from.animationLast = from.nextAnimationLast;
|
||||||
from.trackLast = from.nextTrackLast;
|
from.trackLast = from.nextTrackLast;
|
||||||
|
|
||||||
if (to.nextTrackLast != -1) { // The from entry was applied at least once.
|
// The from entry was applied at least once and the mix is complete.
|
||||||
const discard = to.mixTime == 0 && from.mixTime == 0; // Discard the from entry when neither have advanced yet.
|
if (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) {
|
||||||
if (to.mixTime >= to.mixDuration || discard) {
|
// Mixing is complete for all entries before the from entry or the mix is instantaneous.
|
||||||
// Require totalAlpha == 0 to ensure mixing is complete or the transition is a single frame or discarded.
|
if (from.totalAlpha == 0 || to.mixDuration == 0) {
|
||||||
if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) {
|
|
||||||
to.mixingFrom = from.mixingFrom;
|
to.mixingFrom = from.mixingFrom;
|
||||||
if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
|
if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
|
||||||
to.interruptAlpha = from.interruptAlpha;
|
to.interruptAlpha = from.interruptAlpha;
|
||||||
@ -150,7 +149,6 @@ export class AnimationState {
|
|||||||
}
|
}
|
||||||
return finished;
|
return finished;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
from.trackTime += delta * from.timeScale;
|
from.trackTime += delta * from.timeScale;
|
||||||
to.mixTime += delta;
|
to.mixTime += delta;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user