mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[csharp] UpdateMixingFrom fixes.
This commit is contained in:
parent
d66df0775b
commit
25c2ca7b1b
@ -102,9 +102,9 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
UpdateMixingFrom(current, delta, true);
|
UpdateMixingFrom(current, delta);
|
||||||
} else {
|
} else {
|
||||||
UpdateMixingFrom(current, delta, true);
|
UpdateMixingFrom(current, delta);
|
||||||
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
||||||
if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {
|
if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {
|
||||||
tracksItems[i] = null;
|
tracksItems[i] = null;
|
||||||
@ -120,27 +120,22 @@ namespace Spine {
|
|||||||
queue.Drain();
|
queue.Drain();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateMixingFrom (TrackEntry entry, float delta, bool canEnd) {
|
private void UpdateMixingFrom (TrackEntry entry, float delta) {
|
||||||
TrackEntry from = entry.mixingFrom;
|
TrackEntry from = entry.mixingFrom;
|
||||||
if (from == null) return;
|
if (from == null) return;
|
||||||
|
|
||||||
if (canEnd && entry.mixTime >= entry.mixDuration && entry.mixTime > 0) {
|
UpdateMixingFrom(from, delta);
|
||||||
|
|
||||||
|
if (entry.mixTime >= entry.mixDuration && from.mixingFrom == null && entry.mixTime > 0) {
|
||||||
|
entry.mixingFrom = null;
|
||||||
queue.End(from);
|
queue.End(from);
|
||||||
TrackEntry newFrom = from.mixingFrom;
|
return;
|
||||||
entry.mixingFrom = newFrom;
|
|
||||||
if (newFrom == null) return;
|
|
||||||
entry.mixTime = from.mixTime;
|
|
||||||
entry.mixDuration = from.mixDuration;
|
|
||||||
from = newFrom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
from.animationLast = from.nextAnimationLast;
|
from.animationLast = from.nextAnimationLast;
|
||||||
from.trackLast = from.nextTrackLast;
|
from.trackLast = from.nextTrackLast;
|
||||||
float mixingFromDelta = delta * from.timeScale;
|
from.trackTime += delta * from.timeScale;
|
||||||
from.trackTime += mixingFromDelta;
|
entry.mixTime += delta * entry.timeScale;
|
||||||
entry.mixTime += mixingFromDelta;
|
|
||||||
|
|
||||||
UpdateMixingFrom(from, delta, canEnd && from.alpha == 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user