LineCtrl.js 509 B

123456789101112131415161718192021222324
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. lineSkeleton: sp.Skeleton,
  5. },
  6. onLoad() {
  7. this.node.opacity = 0;
  8. this.lineSkeleton.setAnimation(0, 'lx1_stand', true);
  9. this.node.runAction(cc.fadeIn(0.4));
  10. },
  11. showAnimation(cb) {
  12. this.lineSkeleton.setAnimation(0, 'lx1_run', false);
  13. this.lineSkeleton.setCompleteListener(() => {
  14. this.lineSkeleton.setAnimation(0, 'lx1_stand', true);
  15. cb();
  16. });
  17. }
  18. });