LineCtrl.js 509 B

123456789101112131415161718192021222324
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. lineSkeleton: sp.Skeleton,
  5. },
  6. onLoad() {
  7. this.lineSkeleton.setAnimation(0, 'lx1_stand', true);
  8. },
  9. showAnimation(cb) {
  10. this.node.opacity = 0;
  11. this.node.runAction(cc.fadeIn(0.2));
  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. });