diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index 55501f0..941b7b9 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -963,6 +963,23 @@ export default class JiaZai extends cc.Component { } cc.fx.AudioManager._instance.playEffect("anniu_Big", null); let version = cc.fx.GameTool.getWechatGameVersion(); + + let power = cc.fx.GameTool.getUserPowerTime(); + if (cc.fx.GameConfig.GM_INFO.hp < 1 && power == false) { + MiniGameSdk.API.showToast("体力值不足"); + setTimeout(() => { + this.openHeath(); + }, 500); + return; + } + //@ts-ignore + if (typeof wx !== 'undefined') { + //@ts-ignore + wx.offShow(this.onShowListener); + //@ts-ignore + wx.offHide(this.onHideListener); + } + if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.otherLevel == 0) { // if (version != "开发版" && version != "体验版") { // MiniGameSdk.API.showToast("关卡每周更新,敬请期待!"); @@ -1004,22 +1021,6 @@ export default class JiaZai extends cc.Component { // } } - let power = cc.fx.GameTool.getUserPowerTime(); - if (cc.fx.GameConfig.GM_INFO.hp < 1 && power == false) { - MiniGameSdk.API.showToast("体力值不足"); - setTimeout(() => { - this.openHeath(); - }, 500); - return; - } - //@ts-ignore - if (typeof wx !== 'undefined') { - //@ts-ignore - wx.offShow(this.onShowListener); - //@ts-ignore - wx.offHide(this.onHideListener); - } - if (this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl")._touch) { this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl").setTouch(false); let version = cc.fx.GameTool.getWechatGameVersion();