BackBtn.js 704 B

123456789101112131415161718192021222324252627282930
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. start () {
  6. this.countAniTime = 0;
  7. this.animation = this.node.getComponent(cc.Animation);
  8. this.animation.on('finished', this.onFinished,this);
  9. this.animation.play();
  10. },
  11. onFinished: function (num, string) {
  12. this.countAniTime++;
  13. if(this.countAniTime == 3)
  14. {
  15. this.scheduleOnce(function(){
  16. this.countAniTime = 0;
  17. this.animation.play();
  18. },2);
  19. return;
  20. }
  21. this.animation.play();
  22. //console.log('onAnimCompleted: param1[%s], param2[%s]', num, string);
  23. }
  24. });