FriendSystem.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Learn cc.Class:
  2. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
  3. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
  4. // Learn Attribute:
  5. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
  6. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
  7. // Learn life-cycle callbacks:
  8. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
  9. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
  10. cc.Class({
  11. extends: cc.Component,
  12. properties: {
  13. },
  14. // LIFE-CYCLE CALLBACKS:
  15. init(endPosition) {
  16. this.endPosition = endPosition;
  17. },
  18. onLoad () {},
  19. closeFriendSystem: function () {
  20. let moveAction = cc.moveBy(0.35, this.endPosition);
  21. let scaleAction = cc.scaleTo(0.35, 0.1, 0.1);
  22. let spawn = cc.spawn([moveAction, scaleAction, cc.fadeOut(0.4)]);
  23. let callBack = cc.callFunc(function () {
  24. this.node.destroy();
  25. }, this);
  26. let sequence = cc.sequence(spawn, callBack);
  27. this.node.runAction(sequence);
  28. },
  29. inviteFriend: function () {
  30. },
  31. // update (dt) {},
  32. });