修复BUG

This commit is contained in:
YZ\249929363 2025-08-07 17:53:25 +08:00
parent 9d8ad6307c
commit 7fa2297b81
5 changed files with 453 additions and 204 deletions

View File

@ -2065,9 +2065,9 @@ export default class MapConroler extends cc.Component {
//使用时间道具 //使用时间道具
useTimeProp() { useTimeProp() {
var pause = this.iceTrue();
console.log("冰冻状态:", pause);
if (this.node.parent.getChildByName("Ice").active == true || this.timeNumber <= 1 || this.gameOver || this.gameWin) { if (pause == true) {
return; return;
} }
let freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn"); let freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
@ -2158,8 +2158,12 @@ export default class MapConroler extends cc.Component {
handleBuySuccess(data) { handleBuySuccess(data) {
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn(); this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
this.updateCoin(); this.updateCoin();
this.pause = false; var pause = this.iceTrue();
this.startBoom(); if (pause == false) {
this.pause = false;
this.startBoom();
}
const timestamp = Date.now(); const timestamp = Date.now();
// console.log("回调函数内:",this.pause); // console.log("回调函数内:",this.pause);
let freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn"); let freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
@ -3274,6 +3278,15 @@ export default class MapConroler extends cc.Component {
} }
} }
iceTrue() {
if (this.node.parent.getChildByName("Ice").active == true || this.timeNumber <= 1 || this.gameOver || this.gameWin) {
return true;
}
else {
return false;
}
}
update(dt) { update(dt) {

View File

@ -315,7 +315,8 @@ export default class SceneManager extends cc.Component {
cc.fx.AudioManager._instance.playEffect("anniu_little", null); cc.fx.AudioManager._instance.playEffect("anniu_little", null);
this.pause.getComponent("btnControl").setTouch(true); this.pause.getComponent("btnControl").setTouch(true);
this.node.getChildByName("Pause").active = false; this.node.getChildByName("Pause").active = false;
if (MapConroler._instance.node.parent.getChildByName("Ice").active == false) { var pause = MapConroler._instance.iceTrue();
if (pause == false) {
MapConroler._instance.pause = false; MapConroler._instance.pause = false;
MapConroler._instance.startBoom(); MapConroler._instance.startBoom();
} }
@ -418,8 +419,12 @@ export default class SceneManager extends cc.Component {
closePropBuy() { closePropBuy() {
MapConroler._instance.pause = false; var pause = MapConroler._instance.iceTrue();
MapConroler._instance.startBoom(); if (pause == false) {
MapConroler._instance.pause = false;
MapConroler._instance.startBoom();
}
let freezeBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("timeBtn"); let freezeBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
let hammerBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn"); let hammerBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn");
let magicBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("magicBtn"); let magicBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("magicBtn");

View File

@ -8,8 +8,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1966, "width": 2008,
"height": 922, "height": 938,
"platformSettings": {}, "platformSettings": {},
"subMetas": {} "subMetas": {}
} }

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,10 @@ export default class NewClass extends cc.Component {
} }
init() { init() {
let flag = cc.fx.GameTool.getSetScreenResolutionFlag();
if (flag) {
this.node.getChildByName("itemcontent").getChildByName("view").height = 1500;
}
this.onShowListener = null; this.onShowListener = null;
if (cc.sys.platform === cc.sys.WECHAT_GAME) { if (cc.sys.platform === cc.sys.WECHAT_GAME) {
// 定义监听函数 // 定义监听函数
@ -616,8 +620,15 @@ export default class NewClass extends cc.Component {
//无限体力刷新功能 //无限体力刷新功能
updatePower() { updatePower() {
console.log("无限体力时间戳:", cc.fx.GameConfig.GM_INFO.userPowerTime) console.log("无限体力时间戳:", cc.fx.GameConfig.GM_INFO.userPowerTime);
MapConroler._instance.setPropNum(); const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点
if (winCOIN) {
const wincoin = winCOIN.getComponent(SceneManager);
if (wincoin) {
MapConroler._instance.setPropNum();
console.log("局内");
};
}
if (cc.fx.GameConfig.GM_INFO.userPowerTime != 0) { if (cc.fx.GameConfig.GM_INFO.userPowerTime != 0) {
let nowTime = Math.floor(Date.now() / 1000); let nowTime = Math.floor(Date.now() / 1000);
if (cc.fx.GameConfig.GM_INFO.userPowerTime > nowTime) { if (cc.fx.GameConfig.GM_INFO.userPowerTime > nowTime) {