看官方动画的文档:
var animation = this.node.getComponent(cc.Animation);
// 注册
animation.on(‘finished’, this.onFinished, this);
// 取消注册
animation.off(‘finished’, this.onFinished, this);
注册和取消注册不在一个文件里面写,我这里就单纯的取消完成事件的绑定,为啥还要我把之前的函数再次传入???
希望这样:
animation.off(‘finished’);