dialog.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Learn cc.Class:
  2. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
  3. // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
  4. // Learn Attribute:
  5. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
  6. // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
  7. // Learn life-cycle callbacks:
  8. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
  9. // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
  10. cc.Class({
  11. extends: cc.Component,
  12. properties: {
  13. pauseNode: cc.Node,
  14. },
  15. // LIFE-CYCLE CALLBACKS:
  16. // onLoad () {},
  17. start() {
  18. this.setInfo();
  19. },
  20. setInfo: function () {
  21. this.pauseNode.getChildByName("info").getComponent(cc.Label).string = MySetting.suspend_text;
  22. console.log("暂停设置为", MySetting.suspend_text);
  23. },
  24. setShow: function (type) {
  25. if (type == 0) {
  26. this.pauseNode.active = false;
  27. } else if (type == 1) {
  28. this.pauseNode.active = true;
  29. }
  30. }
  31. // update (dt) {},
  32. });