-
Creator 版本:1.10.2
-
目标平台:
-
编辑器操作系统 :Windows
//初始化
initA(){
let childNode = cc.find(“mao”,this.effectSpineNode);
childNode.getComponent(sp.Skeleton).setEventListener(this.spineEventCallback.bind(this));
}spineEventCallback(skeletonNode, trackEntry, eventType, event, loopCount) {
console.log(skeletonNode);
console.log(trackEntry);
console.log(eventType);
console.log(event);
console.log(loopCount);// 如果动画播放完成且名字等于run,则销毁该节点 if (eventType === sp.AnimationEventType.COMPLETE && trackEntry.animation && trackEntry.animation.name === 'idle') { this.node.destroy(); }}
如上代码,添加setEventListener事件,不触发,播放完成后无事件