mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[lua] Fix for clearTracks, see #805
This commit is contained in:
parent
a596aa49e7
commit
2be667dd62
@ -496,12 +496,13 @@ end
|
|||||||
function AnimationState:clearTracks ()
|
function AnimationState:clearTracks ()
|
||||||
local queue = self.queue
|
local queue = self.queue
|
||||||
local tracks = self.tracks
|
local tracks = self.tracks
|
||||||
|
local oldDrainDisabled = queue.drainDisabled
|
||||||
queue.drainDisabled = true;
|
queue.drainDisabled = true;
|
||||||
for i,track in pairs(tracks) do
|
for i,track in pairs(tracks) do
|
||||||
self:clearTrack(i)
|
self:clearTrack(i)
|
||||||
end
|
end
|
||||||
tracks = {}
|
tracks = {}
|
||||||
queue.drainDisabled = false;
|
queue.drainDisabled = oldDrainDisabled
|
||||||
queue:drain();
|
queue:drain();
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -635,11 +636,12 @@ end
|
|||||||
|
|
||||||
function AnimationState:setEmptyAnimations (mixDuration)
|
function AnimationState:setEmptyAnimations (mixDuration)
|
||||||
local queue = self.queue
|
local queue = self.queue
|
||||||
|
local oldDrainDisabled = queue.drainDisabled
|
||||||
queue.drainDisabled = true
|
queue.drainDisabled = true
|
||||||
for i,current in pairs(self.tracks) do
|
for i,current in pairs(self.tracks) do
|
||||||
if current then self:setEmptyAnimation(current.trackIndex, mixDuration) end
|
if current then self:setEmptyAnimation(current.trackIndex, mixDuration) end
|
||||||
end
|
end
|
||||||
queue.drainDisabled = false
|
queue.drainDisabled = oldDrainDisabled
|
||||||
queue:drain()
|
queue:drain()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user