feat(assets/animator): handle sending callbacks when animation end
This commit is contained in:
parent
f61f529302
commit
76fb15f862
1 changed files with 14 additions and 0 deletions
|
@ -120,6 +120,20 @@ function Animator:getDimensions()
|
||||||
return self.sprite:getDimensions()
|
return self.sprite:getDimensions()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- CALLBACK FUNCTIONS
|
||||||
|
-- Handle getting a calback from the animation system
|
||||||
|
|
||||||
|
function Animator:setCallbackTarget(callbackTarget)
|
||||||
|
self.callbackTarget = callbackTarget
|
||||||
|
end
|
||||||
|
|
||||||
|
function Animator:sendCallback()
|
||||||
|
if (self.callbackTarget ~= nil) then
|
||||||
|
if (self.callbackTarget.animationEnded ~= nil) then
|
||||||
|
self.callbackTarget:animationEnded(self.currentAnimation)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
-- DRAW FUNCTIONS
|
-- DRAW FUNCTIONS
|
||||||
-- Draw animations using these functions
|
-- Draw animations using these functions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue