From 704e2f113c4920b8e0132864c84db5d5a4276cfd Mon Sep 17 00:00:00 2001 From: "YZ\\249929363" <249929363@qq.com> Date: Tue, 8 Jul 2025 18:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Map.ts | 29 +++++++++++++++++++---------- assets/Script/SceneManager.ts | 1 + 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 8a1a88f..2d81377 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -1346,8 +1346,9 @@ export default class MapConroler extends cc.Component { if (this.blockNum == 0 && !this.gameWin && !this.gameOver) { // alert("游戏成功"); + MiniGameSdk.API.showToast(cc.fx.GameConfig.GM_INFO.level); this.gameWin = true; - console.log("恢复一点体力") + console.log("恢复一点体力",cc.fx.GameConfig.GM_INFO.level); cc.fx.GameTool.setUserHealth(1, (data) => { }) this.stopTimeCutDown(); @@ -1390,7 +1391,6 @@ export default class MapConroler extends cc.Component { } winLevel() { - if(this.node.parent.parent.getChildByName("Win"). getChildByName("nextBtn").getComponent("btnControl")._touch == false){ return; @@ -1398,9 +1398,18 @@ export default class MapConroler extends cc.Component { this.node.parent.parent.getChildByName("Win"). getChildByName("nextBtn").getComponent("btnControl").setTouch(false); cc.fx.AudioManager._instance.playEffect("anniu_Big", null); + console.log("下一关",cc.fx.GameConfig.GM_INFO.level); if (cc.fx.GameConfig.GM_INFO.level > 249) { cc.fx.GameConfig.GM_INFO.level = 249; MiniGameSdk.API.showToast("每周更新,敬请期待!"); + setTimeout(() => { + this.node.parent.parent.getChildByName("Win"). + getChildByName("nextBtn").getComponent("btnControl").setTouch(true); + }, 500); + + } + else if (cc.fx.GameConfig.GM_INFO.level == 249) { + MiniGameSdk.API.showToast("每周更新,敬请期待!"); } else { // console.log("下一关"); @@ -1749,8 +1758,8 @@ export default class MapConroler extends cc.Component { setTimeout(() => { this.setPropNum(); // this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString(); - MiniGameSdk.API.showToast("购买冻结时间道具成功"); - }, 200); + MiniGameSdk.API.showToast("购买冻结时间成功"); + }, 2000); } @@ -1762,14 +1771,14 @@ export default class MapConroler extends cc.Component { cc.fx.StorageMessage.setStorage("prop", propInfo); this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy(); setTimeout(() => { - MiniGameSdk.API.showToast("购买锤子道具成功"); + MiniGameSdk.API.showToast("购买魔法棒成功"); this.setPropNum(); // this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString(); - }, 200); + }, 2000); } else if (data == "hammerAmount") { - cc.fx.GameConfig.GM_INFO.hammerAmount += 3; + cc.fx.GameConfig.GM_INFO.hammerAmount += 1; let propInfo = cc.fx.StorageMessage.getStorage("prop"); propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount; propInfo.timestamp = timestamp; @@ -1778,8 +1787,8 @@ export default class MapConroler extends cc.Component { setTimeout(() => { this.setPropNum(); // this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString(); - MiniGameSdk.API.showToast("购买魔法棒道具成功"); - }, 200); + MiniGameSdk.API.showToast("购买锤子成功"); + }, 2000); } @@ -1852,7 +1861,7 @@ export default class MapConroler extends cc.Component { } buyHammer() { - if (cc.fx.GameConfig.GM_INFO.coin < 1500) { + if (cc.fx.GameConfig.GM_INFO.coin < 1000) { MiniGameSdk.API.showToast("金币不足,无法购买道具"); setTimeout(() => { this.openShop(); diff --git a/assets/Script/SceneManager.ts b/assets/Script/SceneManager.ts index 3cb3416..622ca09 100644 --- a/assets/Script/SceneManager.ts +++ b/assets/Script/SceneManager.ts @@ -288,6 +288,7 @@ export default class SceneManager extends cc.Component { openPropBuy(name) { MapConroler._instance.pause = true; MapConroler._instance.stopBoom(); + this.btnName = name; let propWindow = this.node.getChildByName("Game").getChildByName("propWindow"); propWindow.active = true;