From 0fe42d5322fa957f7b885effb0ef7b61d02478ab Mon Sep 17 00:00:00 2001 From: "YZ\\249929363" <249929363@qq.com> Date: Tue, 8 Jul 2025 10:37:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E5=8A=9B=E6=89=A3=E9=99=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/JiaZai.ts | 1 + assets/Script/Map.ts | 15 +++++--- assets/Script/SceneManager.ts | 4 +- assets/res/font/font.png.meta | 4 +- assets/shop/img/texture_atlas-1.png.meta | 4 +- assets/shop/script/shop.ts | 49 ++++++++++++------------ 6 files changed, 42 insertions(+), 35 deletions(-) diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index 491741c..a0f1862 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -232,6 +232,7 @@ stopHeathTimeCutDown() { if (this.Stamina && this.Stamina.getChildByName("time")) { this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; } + MiniGameSdk.API.showToast("恢复一点体力"); cc.fx.GameTool.setUserHealth(1, (data) => { cc.fx.GameTool.getHealth(null); this.setHealthInfo(); diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 9981bd3..8af7622 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -217,6 +217,8 @@ export default class MapConroler extends cc.Component { startUpdate() { if (this.gameStart == false) { this.gameStart = true; + cc.fx.GameTool.setUserHealth(-1, (data) => { + }) this.count_Time = Date.now(); //发送数数事件——进入关卡 console.log("准备进入下一关,发送下一关进入"); @@ -1345,7 +1347,9 @@ export default class MapConroler extends cc.Component { if (this.blockNum == 0 && !this.gameWin && !this.gameOver) { // alert("游戏成功"); this.gameWin = true; - + console.log("恢复一点体力") + cc.fx.GameTool.setUserHealth(1, (data) => { + }) this.stopTimeCutDown(); // console.log("即将上报成功________________________:",this.add_Time); // console.log("成功消除一个",this.add_Time); @@ -1547,10 +1551,11 @@ export default class MapConroler extends cc.Component { result: "fail" } cc.fx.GameTool.shushu_Track("finish_stage", data); - if (this.gameStart == true) { - cc.fx.GameTool.setUserHealth(-1, (data) => { - }) - } + + // if (this.gameStart == true) { + // cc.fx.GameTool.setUserHealth(-1, (data) => { + // }) + // } // this.node.parent.parent.parent.destroy(); } diff --git a/assets/Script/SceneManager.ts b/assets/Script/SceneManager.ts index 87a7264..78e2851 100644 --- a/assets/Script/SceneManager.ts +++ b/assets/Script/SceneManager.ts @@ -192,8 +192,8 @@ export default class SceneManager extends cc.Component { this.closePause(); if (MapConroler._instance.gameStart == true) { MiniGameSdk.API.showToast("体力值减少"); - cc.fx.GameTool.setUserHealth(-1, (data) => { - }) + // cc.fx.GameTool.setUserHealth(-1, (data) => { + // }) if (MapConroler._instance.count_Time) { let overTime = Date.now(); let count_Time = overTime - MapConroler._instance.count_Time; diff --git a/assets/res/font/font.png.meta b/assets/res/font/font.png.meta index 4203403..3e51a01 100644 --- a/assets/res/font/font.png.meta +++ b/assets/res/font/font.png.meta @@ -8,8 +8,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, - "width": 1997, - "height": 251, + "width": 504, + "height": 1053, "platformSettings": {}, "subMetas": {} } \ No newline at end of file diff --git a/assets/shop/img/texture_atlas-1.png.meta b/assets/shop/img/texture_atlas-1.png.meta index e4534d6..ef65f0f 100644 --- a/assets/shop/img/texture_atlas-1.png.meta +++ b/assets/shop/img/texture_atlas-1.png.meta @@ -8,8 +8,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, - "width": 1833, - "height": 791, + "width": 1831, + "height": 826, "platformSettings": {}, "subMetas": {} } \ No newline at end of file diff --git a/assets/shop/script/shop.ts b/assets/shop/script/shop.ts index c709f60..a2dda8a 100644 --- a/assets/shop/script/shop.ts +++ b/assets/shop/script/shop.ts @@ -101,7 +101,7 @@ export default class NewClass extends cc.Component { } - setHealthInfo() { + setHealthInfo() { if (cc.fx.GameConfig.GM_INFO.hp >= 5) { this.Stamina.getChildByName("man").active = true; this.Stamina.getChildByName("health").active = true; @@ -122,31 +122,32 @@ export default class NewClass extends cc.Component { } startTimeCutDown() { - this.scheduleCallback = function () { - if (this.pause) return; - if (cc.fx.GameConfig.GM_INFO.min_Time <= 0) { - this.stopTimeCutDown(); - var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); - // 同步显示 - if (this.Stamina && this.Stamina.getChildByName("time")) { - this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; + this.scheduleCallback = function () { + if (this.pause) return; + if (cc.fx.GameConfig.GM_INFO.min_Time <= 0) { + this.stopTimeCutDown(); + var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + // 同步显示 + if (this.Stamina && this.Stamina.getChildByName("time")) { + this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; + } + MiniGameSdk.API.showToast("恢复一点滴点体力"); + cc.fx.GameTool.setUserHealth(1, (data) => { + cc.fx.GameTool.getHealth(null); + this.setHealthInfo(); + }) } - cc.fx.GameTool.setUserHealth(1, (data) => { - cc.fx.GameTool.getHealth(null); - this.setHealthInfo(); - }) - } - else { - cc.fx.GameConfig.GM_INFO.min_Time -= 1; - var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); - // 同步显示 - if (this.Stamina && this.Stamina.getChildByName("time")) { - this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; + else { + cc.fx.GameConfig.GM_INFO.min_Time -= 1; + var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + // 同步显示 + if (this.Stamina && this.Stamina.getChildByName("time")) { + this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; + } } - } - }.bind(this); - this.schedule(this.scheduleCallback, 1); -} + }.bind(this); + this.schedule(this.scheduleCallback, 1); + } // 停止倒计时 stopTimeCutDown() {