大更新,更新礼包

This commit is contained in:
YZ\249929363 2025-07-18 19:10:58 +08:00
parent 36924eed8a
commit 4f020d19d0
5 changed files with 27 additions and 11 deletions

View File

@ -177,10 +177,18 @@ export default class GameManager extends cc.Component {
cc.director.loadScene("HomeScene"); cc.director.loadScene("HomeScene");
} else { } else {
console.log('music bundle 加载成功'); console.log('music bundle 加载成功');
cc.assetManager.loadBundle('shop', (err, bundle) => {
if (err) {
console.error('加载 shop 失败:', err);
} else {
console.log('shop加载成功');
// 加载成功后进入 HomeScene // 加载成功后进入 HomeScene
cc.director.loadScene("HomeScene"); cc.director.loadScene("HomeScene");
} }
}); });
}
});
} }
returnHome() { returnHome() {

View File

@ -198,10 +198,17 @@ export default class JiaZai extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.hp < 5) { if (cc.fx.GameConfig.GM_INFO.hp < 5) {
this.startHeathTimeCutDown(timeNode); this.startHeathTimeCutDown(timeNode);
} }
if (cc.fx.GameConfig.GM_INFO.hp == 0 && cc.fx.GameConfig.GM_INFO.userPowerTime == 0) { if (cc.fx.GameConfig.GM_INFO.hp == 0) {
if (cc.fx.GameConfig.GM_INFO.userPowerTime == 0) {
// 体力为0显示spriteFrames[1],只显示第二个按钮 // 体力为0显示spriteFrames[1],只显示第二个按钮
if (switchButtons[0]) { switchButtons[0].active = false; swichs[0].active = false; } if (switchButtons[0]) { switchButtons[0].active = false; swichs[0].active = false; }
if (switchButtons[1]) { switchButtons[1].active = true; swichs[1].active = true; } if (switchButtons[1]) { switchButtons[1].active = true; swichs[1].active = true; }
}
else {
if (switchButtons[0]) { switchButtons[0].active = true; swichs[0].active = false; }
if (switchButtons[1]) { switchButtons[1].active = false; swichs[1].active = true; }
}
} else if (cc.fx.GameConfig.GM_INFO.hp < 5 && cc.fx.GameConfig.GM_INFO.hp > 0) { } else if (cc.fx.GameConfig.GM_INFO.hp < 5 && cc.fx.GameConfig.GM_INFO.hp > 0) {
// 体力小于5但大于0显示spriteFrames[1],只显示第一个按钮 // 体力小于5但大于0显示spriteFrames[1],只显示第一个按钮
if (switchButtons[0]) { switchButtons[0].active = true; swichs[0].active = false; } if (switchButtons[0]) { switchButtons[0].active = true; swichs[0].active = false; }
@ -367,7 +374,8 @@ export default class JiaZai extends cc.Component {
startGame() { startGame() {
cc.fx.AudioManager._instance.playEffect("anniu_Big", null); cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
if (cc.fx.GameConfig.GM_INFO.hp < 1 && cc.fx.GameConfig.GM_INFO.userPowerTime == 0) { let power = cc.fx.GameTool.getUserPowerTime();
if (cc.fx.GameConfig.GM_INFO.hp < 1 && power == false) {
MiniGameSdk.API.showToast("体力值不足"); MiniGameSdk.API.showToast("体力值不足");
setTimeout(() => { setTimeout(() => {
this.openHeath(); this.openHeath();

View File

@ -4,7 +4,7 @@
"importer": "folder", "importer": "folder",
"isBundle": true, "isBundle": true,
"bundleName": "shop", "bundleName": "shop",
"priority": 6, "priority": 8,
"compressionType": { "compressionType": {
"wechatgame": "subpackage" "wechatgame": "subpackage"
}, },

View File

@ -3,6 +3,6 @@
"orientation": "portrait", "orientation": "portrait",
"separate_engine": false, "separate_engine": false,
"REMOTE_SERVER_ROOT": "", "REMOTE_SERVER_ROOT": "",
"subContext": "SubContextView", "subContext": "",
"startSceneAssetBundle": true "startSceneAssetBundle": true
} }