this.animNode.play(‘aaa’).repeatCount=3;
this.animNode.on(‘play’,function () {
console.log(“play”);
},this)
this.animNode.on(‘lastframe’,function () {
console.log(“播放动画了”);
},this)
只打印了play 不能监听每循环一次?
onResume也只打印一次
this.animNode.play(‘aaa’).repeatCount=3;
this.animNode.on(‘play’,function () {
console.log(“play”);
},this)
this.animNode.on(‘lastframe’,function () {
console.log(“播放动画了”);
},this)
只打印了play 不能监听每循环一次?
onResume也只打印一次
以后标题不要加 

或类似的符号,我已经帮你手工改过五六次了。
尊重一下论坛里的引擎开发团队和其他开发者。如果大家标题都这么搞的话,整个论坛帖子列表就没法看了。
活捉王哲
动画问题怎么说 设置了循环次数repeatCount 却监听不了每次循环后 “lastframe” 甚至自带的AnimationState 里面的onResume也监听不了
aaa:cc.SpriteAtlas,
animNode:cc.Animation,
console.log(this.aaa.getSpriteFrames());
var clip = cc.AnimationClip.createWithSpriteFrames(this.aaa.getSpriteFrames(), 10);
this.animNode.addClip(clip, ‘aaa’);
var aa=this.animNode.play(‘aaa’);
aa.repeatCount=3;
this.animNode.on(‘play’,function () {
console.log(“play”);
},this);
this.animNode.on(‘finished’,function () {
console.log(“finished”);
},this);
this.animNode.on(‘lastframe’,function () {
console.log(“lastframe”);
},this);
aa.onPlay(console.log(“onPlay”));
aa.onResume(console.log(“onResume”));
看看源码,不过这个火的标志,让我想起了 烫烫烫烫烫烫烫烫烫烫!
已经在排查了,耐心等待,如果你急着用可以先用 state 注册:
var state = this.animNode.play('dddd');
state.repeatCount = 3;
this.animNode.on('play', function () {
console.log("play");
}, this)
state.on('lastframe', function () {
console.log("播放动画了");
}, this)
```
嗯 AnimationState里面没有监听“lastframe“的居然可以。。并且state.onResume()之类的 会让监听play多打印了一次。。