更新月卡逻辑
This commit is contained in:
parent
13f5d08d4d
commit
4d5be00483
|
@ -1698,7 +1698,7 @@ export default class MapConroler extends cc.Component {
|
||||||
MiniGameSdk.API.showToast("体力值不足");
|
MiniGameSdk.API.showToast("体力值不足");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.openShop();
|
this.openShop();
|
||||||
}, 200);
|
}, 500);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.againCanTouch) return;
|
if (!this.againCanTouch) return;
|
||||||
|
|
|
@ -72,6 +72,7 @@ export default class SceneManager extends cc.Component {
|
||||||
load3: boolean = false;
|
load3: boolean = false;
|
||||||
btnName: string = '';
|
btnName: string = '';
|
||||||
callBack: any;
|
callBack: any;
|
||||||
|
share_time: boolean = true;
|
||||||
|
|
||||||
|
|
||||||
// LIFE-CYCLE CALLBACKS:
|
// LIFE-CYCLE CALLBACKS:
|
||||||
|
@ -200,7 +201,7 @@ export default class SceneManager extends cc.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
this.share_time = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
startGame() {
|
startGame() {
|
||||||
|
@ -376,6 +377,7 @@ export default class SceneManager extends cc.Component {
|
||||||
|
|
||||||
//打开商店
|
//打开商店
|
||||||
openShop() {
|
openShop() {
|
||||||
|
console.log("进入sceneManager openShop");
|
||||||
if (!SceneManager.cachedShopPrefab) {
|
if (!SceneManager.cachedShopPrefab) {
|
||||||
cc.error('Shop prefab is not loaded yet.');
|
cc.error('Shop prefab is not loaded yet.');
|
||||||
return;
|
return;
|
||||||
|
@ -460,6 +462,8 @@ export default class SceneManager extends cc.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
shareFriend() {
|
shareFriend() {
|
||||||
|
if (this.share_time) {
|
||||||
|
this.share_time = false;
|
||||||
console.log("设置分享链接");
|
console.log("设置分享链接");
|
||||||
let timeStamp = Date.now();
|
let timeStamp = Date.now();
|
||||||
let otherInfo = {
|
let otherInfo = {
|
||||||
|
@ -468,6 +472,11 @@ export default class SceneManager extends cc.Component {
|
||||||
}
|
}
|
||||||
cc.fx.StorageMessage.setStorage("otherLevel", otherInfo);
|
cc.fx.StorageMessage.setStorage("otherLevel", otherInfo);
|
||||||
MiniGameSdk.API.shareGame();
|
MiniGameSdk.API.shareGame();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.share_time = true;
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update(dt) {
|
update(dt) {
|
||||||
|
|
|
@ -163,12 +163,12 @@ export default class setUi extends cc.Component {
|
||||||
this.exit.getChildByName("Health").getChildByName("queding").active = true;
|
this.exit.getChildByName("Health").getChildByName("queding").active = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (customEventData == "hp") {
|
// if (customEventData == "hp") {
|
||||||
if (cc.fx.GameConfig.GM_INFO.hp <= 0) {
|
// if (cc.fx.GameConfig.GM_INFO.hp <= 0) {
|
||||||
MiniGameSdk.API.showToast("体力值不足");
|
// MiniGameSdk.API.showToast("体力值不足");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
MapConroler._instance.againLevel();
|
MapConroler._instance.againLevel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user