[lua] AnimationState#apply returns boolean indicating if any timeline was applied. #919

This commit is contained in:
badlogic 2017-06-04 11:01:04 +02:00
parent 061d0d26b2
commit 3e8f3be0e4

View File

@ -366,9 +366,11 @@ function AnimationState:apply (skeleton)
local events = self.events local events = self.events
local tracks = self.tracks local tracks = self.tracks
local queue = self.queue local queue = self.queue
local applied = false
for i,current in pairs(tracks) do for i,current in pairs(tracks) do
if not (current == nil or current.delay > 0) then if not (current == nil or current.delay > 0) then
applied = true
-- Apply mixing from entries first. -- Apply mixing from entries first.
local mix = current.alpha local mix = current.alpha
if current.mixingFrom then if current.mixingFrom then
@ -407,6 +409,7 @@ function AnimationState:apply (skeleton)
end end
queue:drain() queue:drain()
return applied
end end
function AnimationState:applyMixingFrom (to, skeleton) function AnimationState:applyMixingFrom (to, skeleton)