mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 10:16:54 +08:00
Ensure the track entry has the correct time when start and end are fired.
#154
This commit is contained in:
parent
b6f7e50ff7
commit
c7bb3f3af8
@ -68,8 +68,11 @@ public class AnimationState {
|
|||||||
if (next != null) {
|
if (next != null) {
|
||||||
float nextTime = current.lastTime - next.delay;
|
float nextTime = current.lastTime - next.delay;
|
||||||
if (nextTime >= 0) {
|
if (nextTime >= 0) {
|
||||||
next.time = nextTime;
|
float nextDelta = delta * next.timeScale;
|
||||||
|
next.time = nextTime + nextDelta; // For start event to see correct time.
|
||||||
|
current.time += delta * current.timeScale; // For end event to see correct time.
|
||||||
setCurrent(i, next);
|
setCurrent(i, next);
|
||||||
|
next.time -= nextDelta; // Prevent increasing time twice, below.
|
||||||
current = next;
|
current = next;
|
||||||
}
|
}
|
||||||
} else if (!current.loop && current.lastTime >= current.endTime) {
|
} else if (!current.loop && current.lastTime >= current.endTime) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user