ArtistTrainNoJob.js 688 B

1234567891011121314151617181920212223242526272829303132333435
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. content: cc.Node
  5. },
  6. init(cb) {
  7. this.cb = cb || function () {};
  8. },
  9. // LIFE-CYCLE CALLBACKS:
  10. onLoad () {
  11. },
  12. start() {
  13. this.content.scaleX = 0;
  14. this.content.scaleY = 0;
  15. this.content.runAction(cc.scaleTo(0.35, 1, 1).easing(cc.easeBackOut()));
  16. },
  17. dissmiss() {
  18. let finish = cc.callFunc(() => {
  19. this.node.destroy();
  20. this.cb && this.cb();
  21. }, this);
  22. let sequence = cc.sequence(cc.scaleTo(0.2, 0, 0).easing(cc.easeBackIn()), finish)
  23. this.content.runAction(sequence);
  24. },
  25. // update (dt) {},
  26. });