mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Better resetting of pooled TrackEntrys.
This commit is contained in:
parent
bc259b390e
commit
edb50113ea
@ -203,8 +203,6 @@ public class AnimationState {
|
|||||||
TrackEntry entry = Pools.obtain(TrackEntry.class);
|
TrackEntry entry = Pools.obtain(TrackEntry.class);
|
||||||
entry.animation = animation;
|
entry.animation = animation;
|
||||||
entry.loop = loop;
|
entry.loop = loop;
|
||||||
entry.time = 0;
|
|
||||||
entry.lastTime = 0;
|
|
||||||
entry.endTime = animation.getDuration();
|
entry.endTime = animation.getDuration();
|
||||||
setCurrent(trackIndex, entry);
|
setCurrent(trackIndex, entry);
|
||||||
return entry;
|
return entry;
|
||||||
@ -223,8 +221,6 @@ public class AnimationState {
|
|||||||
TrackEntry entry = Pools.obtain(TrackEntry.class);
|
TrackEntry entry = Pools.obtain(TrackEntry.class);
|
||||||
entry.animation = animation;
|
entry.animation = animation;
|
||||||
entry.loop = loop;
|
entry.loop = loop;
|
||||||
entry.time = 0;
|
|
||||||
entry.lastTime = 0;
|
|
||||||
entry.endTime = animation.getDuration();
|
entry.endTime = animation.getDuration();
|
||||||
|
|
||||||
TrackEntry last = expandToIndex(trackIndex);
|
TrackEntry last = expandToIndex(trackIndex);
|
||||||
@ -296,10 +292,13 @@ public class AnimationState {
|
|||||||
AnimationStateListener listener;
|
AnimationStateListener listener;
|
||||||
|
|
||||||
public void reset () {
|
public void reset () {
|
||||||
|
next = null;
|
||||||
|
previous = null;
|
||||||
animation = null;
|
animation = null;
|
||||||
listener = null;
|
listener = null;
|
||||||
next = null;
|
|
||||||
timeScale = 1;
|
timeScale = 1;
|
||||||
|
lastTime = 0;
|
||||||
|
time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Animation getAnimation () {
|
public Animation getAnimation () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user