更新月卡逻辑

This commit is contained in:
YZ\249929363 2025-08-08 18:49:59 +08:00
parent 13f5d08d4d
commit 4d5be00483
3 changed files with 24 additions and 15 deletions

View File

@ -1698,7 +1698,7 @@ export default class MapConroler extends cc.Component {
MiniGameSdk.API.showToast("体力值不足");
setTimeout(() => {
this.openShop();
}, 200);
}, 500);
return;
}
if (!this.againCanTouch) return;

View File

@ -72,6 +72,7 @@ export default class SceneManager extends cc.Component {
load3: boolean = false;
btnName: string = '';
callBack: any;
share_time: boolean = true;
// LIFE-CYCLE CALLBACKS:
@ -200,7 +201,7 @@ export default class SceneManager extends cc.Component {
}
start() {
this.share_time = true;
}
startGame() {
@ -376,6 +377,7 @@ export default class SceneManager extends cc.Component {
//打开商店
openShop() {
console.log("进入sceneManager openShop");
if (!SceneManager.cachedShopPrefab) {
cc.error('Shop prefab is not loaded yet.');
return;
@ -460,14 +462,21 @@ export default class SceneManager extends cc.Component {
}
shareFriend() {
console.log("设置分享链接");
let timeStamp = Date.now();
let otherInfo = {
timeStamp: timeStamp,
otherLevel: (cc.fx.GameConfig.GM_INFO.level + 1),
if (this.share_time) {
this.share_time = false;
console.log("设置分享链接");
let timeStamp = Date.now();
let otherInfo = {
timeStamp: timeStamp,
otherLevel: (cc.fx.GameConfig.GM_INFO.level + 1),
}
cc.fx.StorageMessage.setStorage("otherLevel", otherInfo);
MiniGameSdk.API.shareGame();
setTimeout(() => {
this.share_time = true;
}, 5000);
}
cc.fx.StorageMessage.setStorage("otherLevel", otherInfo);
MiniGameSdk.API.shareGame();
}
update(dt) {

View File

@ -163,12 +163,12 @@ export default class setUi extends cc.Component {
this.exit.getChildByName("Health").getChildByName("queding").active = true;
}
else {
if (customEventData == "hp") {
if (cc.fx.GameConfig.GM_INFO.hp <= 0) {
MiniGameSdk.API.showToast("体力值不足");
return;
}
}
// if (customEventData == "hp") {
// if (cc.fx.GameConfig.GM_INFO.hp <= 0) {
// MiniGameSdk.API.showToast("体力值不足");
// return;
// }
// }
MapConroler._instance.againLevel();
}
}