Yeah I didn’t appear to have issues with multiple calls until the calls were happening more frequently such as every 2 seconds. Certainly everything is multiplied with multiple skeletons.
Also there is no resource drain if you setup a test condition that plays animations within onComplete e.g.
state.onComplete = function (trackIndex, loop)
state:addAnimationByName( data )
end
The drain only occurs when you call the animation function.
Anyway, here’s my Spine library, SpineTrigger, collected with an example project:
https://dl.orangedox.com/fwtujtJVvpG2Ey8npr/spineTrigger.zip
This one creates 6 dragons and sets their animations off. When they each trigger onComplete, they call a function which changes the name of the animation and sends it back into the animation function.
There is a performance function which displays framerate and luaMem. You’ll see this quickly degrade from 60fps down to 1 fps. The memory continues to balloon. So something is compounding somewhere each time the animation function is called. I would have blamed the global nature of Spine but it might be something more or less straight forward…
Steal away. I’ll steel myself for the feedback