cc.Class({ extends: require("baseCharactor"), properties: { }, onLoad () { this.armatureDisplay = this.node.getComponent(dragonBones.ArmatureDisplay); this.armature = this.armatureDisplay.armature(); //添加动画事件监听 this.armatureDisplay.addEventListener(dragonBones.EventObject.COMPLETE, this.animationEventHandler, this); }, start () { }, attack(bLeft){ }, animationEventHandler(event) { if (event.type === dragonBones.EventObject.COMPLETE) { if (event.animationState.name === "attack") { console.log("attack 动作播放完毕!!!"); //TODO: this.armature.animation.play("idle",-1); } } } // update (dt) {}, });