feat(assets/animator): send the callback when the animation end

This commit is contained in:
Kazhnuz 2019-09-07 20:59:44 +02:00
parent e6f0315a8c
commit 60390ed1a7

View file

@ -60,6 +60,7 @@ function Animator:update(dt)
if self.frameTimer > 1 then if self.frameTimer > 1 then
self.frameTimer = 0 self.frameTimer = 0
if self.frame == self.animationData.endAt then if self.frame == self.animationData.endAt then
self:sendCallback()
if not (self.animationData.pauseAtEnd) then if not (self.animationData.pauseAtEnd) then
self.frame = self.animationData.loop self.frame = self.animationData.loop
end end