代码:
this.animation = this.getComponent(cc.Animation);
this.animation.on(“lastframe”,this.onend,this);
this.animation.on(“play”,this.onPlay,this);
var clip = cc.AnimationClip.createWithSpriteFrames(freams, 10);
帧事件
{ frame: 6, func: ‘onAttack’, params:[‘param-1’, ‘param-2’] }
clip 不同模式效果
clip.wrapMode = cc.WrapMode.Loop;
生效lastframe
帧事件生效
不生效play
clip.wrapMode = cc.WrapMode.Normal;
不生效lastframe
帧事件不生效
生效play