ArtistTrainAlert.js 613 B

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