BattleEffect = cc.Class.extend({
ctor: function (url) {
//添加伤害特效
this.node = cc.BuilderReader.load(url);
this.node.animationManager.setCompletedAnimationCallback(this.node, this.onAnimationComplete);
},
getNode: function () {
return this.node;
},
onAnimationComplete: function () {
this.removeFromParent();
}
});
Why manager doesn’t callback in cocos2d-x JSB 2.1.4 which can callbacked in cocos2d-html5 2.1.4?
garfield ho wrote:
BattleEffect = cc.Class.extend({
>
ctor: function (url) {
>
//添加伤害特效
this.node = cc.BuilderReader.load(url);
>
this.node.animationManager.setCompletedAnimationCallback(this.node, this.onAnimationComplete);
>
},
>
getNode: function () {
return this.node;
},
>
onAnimationComplete: function () {
this.removeFromParent();
}
>
});
>
Why manager doesn’t callback in cocos2d-x JSB 2.1.4 which can callbacked in cocos2d-html5 2.1.4?
It must call after method runAnimationsForSequenceNamed called event autoSequenceId was setted.