mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 10:16:01 +08:00
[csharp] Fix recursion in clearTracks.
Issue: https://github.com/EsotericSoftware/spine-runtimes/issues/805 based onf6cf88103cand7dbf7c5268
This commit is contained in:
parent
d2eebdf81f
commit
dc8f89fd65
@ -343,12 +343,13 @@ namespace Spine {
|
||||
/// It may be desired to use <see cref="AnimationState.SetEmptyAnimations(float)"/> to mix the skeletons back to the setup pose,
|
||||
/// rather than leaving them in their previous pose.</summary>
|
||||
public void ClearTracks () {
|
||||
bool oldDrainDisabled = queue.drainDisabled;
|
||||
queue.drainDisabled = true;
|
||||
for (int i = 0, n = tracks.Count; i < n; i++) {
|
||||
ClearTrack(i);
|
||||
}
|
||||
tracks.Clear();
|
||||
queue.drainDisabled = false;
|
||||
queue.drainDisabled = oldDrainDisabled;
|
||||
queue.Drain();
|
||||
}
|
||||
|
||||
@ -510,12 +511,13 @@ namespace Spine {
|
||||
/// <summary>
|
||||
/// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.</summary>
|
||||
public void SetEmptyAnimations (float mixDuration) {
|
||||
bool oldDrainDisabled = queue.drainDisabled;
|
||||
queue.drainDisabled = true;
|
||||
for (int i = 0, n = tracks.Count; i < n; i++) {
|
||||
TrackEntry current = tracks.Items[i];
|
||||
if (current != null) SetEmptyAnimation(i, mixDuration);
|
||||
}
|
||||
queue.drainDisabled = false;
|
||||
queue.drainDisabled = oldDrainDisabled;
|
||||
queue.Drain();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user