修改无尽关卡可以调关

This commit is contained in:
huanghaipeng 2026-01-16 16:51:20 +08:00
parent 398df66037
commit c7fec01378

View File

@ -967,18 +967,38 @@ export default class JiaZai extends cc.Component {
// if (version != "开发版" && version != "体验版") { // if (version != "开发版" && version != "体验版") {
// MiniGameSdk.API.showToast("关卡每周更新,敬请期待!"); // MiniGameSdk.API.showToast("关卡每周更新,敬请期待!");
// cc.fx.GameTool.requestSubscribe(); // 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); // cc.fx.GameConfig.GM_INFO.randomLevel = cc.fx.GameTool.getNextLevel() || 0;
this.node.getChildByName("zhuanchang").active = true; let rLevel = cc.fx.GameConfig.GM_INFO.randomLevel;
this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false); 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; cc.fx.GameConfig.LEVEL_INFO_init(true, 1000, false, true);
let rLevel = cc.fx.GameConfig.GM_INFO.randomLevel; }
cc.fx.StorageMessage.setStorage("randomLevel", rLevel); } else {
console.log("保存玩家随机关卡", rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum) cc.fx.AudioManager._instance.playEffect("zhuan1", null);
Utils.setEndlessLevel(() => { }, rLevel, cc.fx.GameConfig.GM_INFO.endLevelNum); 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; return;
// } // }