| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- // 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() {
- Btn = this;
- this.bg = this.pauseNode.getChildByName("bg");
- this.bg.active = false;
- },
- clickthis: function () {
- utils.isMobile(function () {
- if (manager_android_js.gamestatus == 1) {
- // manager_android_js.gamestatus = 2;
- // this.bg.active = true;
- this.clickPause();
- cc.director.pause();
- console.log("查看数据", Statistics);
- }
- }.bind(this));
- },
- clickShare: function () {
- utils.isMobile(function () {
- manager_android_js.clickShare();
- }.bind(this));
- },
- clickQuit: function () {
- utils.isMobile(function () {
- manager_android_js.clickQuit();
- }.bind(this));
- },
- clickPause: function () {
- utils.isMobile(function () {
- manager_android_js.clickPause();
- }.bind(this));
- },
- clickRest: function () {
- utils.isMobile(function () {
- if (manager_android_js.gamestatus == 2) {
- // manager_android_js.gamestatus = 1;
- this.bg.active = false;
- cc.director.resume();
- manager_android_js.clickRest();
- }
- }.bind(this));
- },
- // update (dt) {},
- });
|