From ba410a03fa182df3b65fb367302a4c95427c7b69 Mon Sep 17 00:00:00 2001 From: "YZ\\249929363" <249929363@qq.com> Date: Mon, 4 Aug 2025 18:02:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=85=E5=80=BC=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/module/Tool/GameTool.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index fface0a..996522f 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -975,7 +975,7 @@ var GameTool = { var rewardData = null; console.log(productId); - console.log("发放奖励"); + console.log("发放奖励", productId); switch (productId) { case "gold_1": cc.fx.GameTool.changeCoin(1200); @@ -1000,7 +1000,7 @@ var GameTool = { coin = 16000; price = 6800; // MiniGameSdk.API.showToast("充值成功,获得16000金币"); - this.rewardData = [ + rewardData = [ { type: "coin", count: coin }, ] break; @@ -1114,8 +1114,11 @@ var GameTool = { } - if (MapConroler._instance != null) + if (MapConroler._instance != null) { + console.log("應該下發獎勵:", rewardData); MapConroler._instance.SceneManager.openRewardWindow(rewardData); + } + else { const canvasTemp = cc.find("Canvas"); // 假设 Canvas 节点 if (canvasTemp) {