From c7fec01378cccb0000dc5680edc265673442f9fe Mon Sep 17 00:00:00 2001 From: huanghaipeng Date: Fri, 16 Jan 2026 16:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A0=E5=B0=BD=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E5=8F=AF=E4=BB=A5=E8=B0=83=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/JiaZai.ts | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index 1e73f29..55501f0 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -967,18 +967,38 @@ export default class JiaZai extends cc.Component { // if (version != "开发版" && version != "体验版") { // MiniGameSdk.API.showToast("关卡每周更新,敬请期待!"); // cc.fx.GameTool.requestSubscribe(); + if (version == "开发版" || version == "体验版") { + if (this.custom.string != "") { + cc.fx.GameConfig.GM_INFO.level = parseInt(this.custom.string) - 1; + this.isShow = false; + cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false); + } + else { + cc.fx.AudioManager._instance.playEffect("zhuan1", null); + this.node.getChildByName("zhuanchang").active = true; + this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false); - cc.fx.AudioManager._instance.playEffect("zhuan1", null); - this.node.getChildByName("zhuanchang").active = true; - this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false); + // cc.fx.GameConfig.GM_INFO.randomLevel = cc.fx.GameTool.getNextLevel() || 0; + let rLevel = cc.fx.GameConfig.GM_INFO.randomLevel; + cc.fx.StorageMessage.setStorage("randomLevel", rLevel); + console.log("保存玩家随机关卡", rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum) + Utils.setEndlessLevel(() => { }, rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum); - // cc.fx.GameConfig.GM_INFO.randomLevel = cc.fx.GameTool.getNextLevel() || 0; - let rLevel = cc.fx.GameConfig.GM_INFO.randomLevel; - cc.fx.StorageMessage.setStorage("randomLevel", rLevel); - console.log("保存玩家随机关卡", rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum) - Utils.setEndlessLevel(() => { }, rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum); + cc.fx.GameConfig.LEVEL_INFO_init(true, 1000, false, true); + } + } else { + cc.fx.AudioManager._instance.playEffect("zhuan1", null); + this.node.getChildByName("zhuanchang").active = true; + this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false); - cc.fx.GameConfig.LEVEL_INFO_init(true, 1000, false, true); + // cc.fx.GameConfig.GM_INFO.randomLevel = cc.fx.GameTool.getNextLevel() || 0; + let rLevel = cc.fx.GameConfig.GM_INFO.randomLevel; + cc.fx.StorageMessage.setStorage("randomLevel", rLevel); + console.log("保存玩家随机关卡", rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum) + Utils.setEndlessLevel(() => { }, rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum); + + cc.fx.GameConfig.LEVEL_INFO_init(true, 1000, false, true); + } return; // }