| 123456789101112131415161718192021222324252627282930313233343536373839 |
- // Learn cc.Class:
- // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
- // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
- // Learn Attribute:
- // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
- // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
- // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
- cc.Class({
- extends: cc.Component,
- properties: {
- pauseNode: cc.Node,
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start() {
- this.setInfo();
- },
- setInfo: function () {
- this.pauseNode.getChildByName("info").getComponent(cc.Label).string = MySetting.suspend_text;
- console.log("暂停设置为", MySetting.suspend_text);
- },
- setShow: function (type) {
- if (type == 0) {
- this.pauseNode.active = false;
- } else if (type == 1) {
- this.pauseNode.active = true;
- }
- }
- // update (dt) {},
- });
|