I switched from CC 2.1.0 to CC 2.1.2 and I get this animation bug with Dragon Bones animation. When I set the event to get when LOOP_COMPLETE event is completed then I switch animation to some other one and everything was okay in CC 2.1.0, but in 2.1.2 I get a glitch (only on native mobile IOS/Android, in web version it’s fine) when loop_complete is called one second later than it should so the animation switch happens second later.
Example:
cc.Class({
extends: cc.Component,
// giftAnimation dragon bone animation is set to play 'enter' animation on load in inspector
properties: {
giftAnimation: dragonBones.ArmatureDisplay // DragonBones Asset
},
onLoad: function()
this.giftAnimation.addEventListener(dragonBones.EventObject.LOOP_COMPLETE, this.animationEventHandler, this);
}
animationEventHandler: function (event) {
if (event.type === dragonBones.EventObject.LOOP_COMPLETE) {
// This plays some time later, so I get a little of beggining enter animation before it switches to idle that should play
if (event.animationState.name === "enter") {
this.giftAnimation.playAnimation('idle', -1);
}
}
}
}
This happens in 2 projects of my that I upgraded to CC 2.1.2, was there any change on Dragon Bones API?
Thanks in advance.