| 123456789101112131415161718192021222324252627282930 |
- cc.Class({
- extends: cc.Component,
- properties: {
-
- },
- start () {
- this.countAniTime = 0;
- this.animation = this.node.getComponent(cc.Animation);
-
- this.animation.on('finished', this.onFinished,this);
- this.animation.play();
-
- },
- onFinished: function (num, string) {
- this.countAniTime++;
- if(this.countAniTime == 3)
- {
- this.scheduleOnce(function(){
- this.countAniTime = 0;
- this.animation.play();
- },2);
- return;
- }
- this.animation.play();
- //console.log('onAnimCompleted: param1[%s], param2[%s]', num, string);
- }
- });
|