问题描述:
使用缓冲池,在播放完动画后,回收节点,再次取出节点的时候,动画还停在最后一帧,不知道如何解决?
下面是核心代码:
// 播放动画,完毕后回收节点
const animate = this.getComponent(cc.Animation)
animate.play('enenmy3');
animate.on('finished', function () {
this.player.score.string = parseInt(this.player.score.string) + this.score
// animate.removeClip(animate.getClips()[0],true)
// this.node.removeComponent(animate)
// 回收节点
this.removeNode(this.node)
}, this);
// 取出节点后,节点还停在动画的最后一帧
this._poolEnemy3 = new cc.NodePool();
let monster
monster = this['_poolEnemy' + name].get();
问题描述:
上面使用animate.removeClip(animate.getClips()[0],true)和this.node.removeComponent(animate),都没用,想知道,在动画onFinished之后,做什么操作,能让精灵回到播放前的状态,求大神指点,如何解决?