cc.Class({ extends: cc.Component, properties: { }, onLoad () { this.anim = this.node.getComponent(sp.Skeleton); this.anim.setCompleteListener(this.SpineEventCallback); }, Run() { //this.anim.animation = 'run';// 要播放的动画名称【必填】 //this.anim.loop = true;// 是否循环 this.runAnim = this.anim.setAnimation(0, 'Run1', true); }, Idel() { this.runAnim = this.anim.setAnimation(0, 'idle', true); }, SpineEventCallback(trackEntry, loopCount) { if (trackEntry.animation.name === 'Run1') { cc.log('Run1结束') } } });