Merge branch 'main' of https://git.sparkus.cn/yangzhao/cb
This commit is contained in:
commit
2de1357398
|
@ -197,8 +197,9 @@ export default class JiaZai extends cc.Component {
|
|||
// //打开heath弹窗
|
||||
// this.openHeath();
|
||||
this.uploadToCloud(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||
// this.rewarded();
|
||||
// this.getMonthlyCardValidityDays();
|
||||
this.rewarded();
|
||||
this.getMonthlyCardValidityDays();
|
||||
console.log('月卡剩余天数 (零点刷新):', cc.fx.GameConfig.GM_INFO.monthTime);
|
||||
Utils.getMonthlyCard((data) => {
|
||||
if (data.code == 1) {
|
||||
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
|
||||
|
@ -480,8 +481,10 @@ export default class JiaZai extends cc.Component {
|
|||
|
||||
if (!this.shopNode) {
|
||||
// 第一次使用,创建节点
|
||||
|
||||
this.shopNode = cc.instantiate(JiaZai.cachedShopPrefab);
|
||||
this.node.addChild(this.shopNode);
|
||||
this.shopNode.getComponent("shop").init();
|
||||
} else {
|
||||
// 非第一次使用,直接激活节点
|
||||
this.shopNode.active = true;
|
||||
|
@ -913,7 +916,7 @@ export default class JiaZai extends cc.Component {
|
|||
const remainingDays = Math.max(0, days);
|
||||
|
||||
cc.fx.GameConfig.GM_INFO.monthTime = remainingDays;
|
||||
console.log('月卡剩余天数 (零点刷新):', remainingDays);
|
||||
// console.log('月卡剩余天数 (零点刷新):', cc.fx.GameConfig.GM_INFO.monthTime );
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
|
|
@ -361,6 +361,7 @@ export default class SceneManager extends cc.Component {
|
|||
// 第一次使用,创建节点
|
||||
this.shopNode = cc.instantiate(SceneManager.cachedShopPrefab);
|
||||
this.node.addChild(this.shopNode);
|
||||
this.shopNode.getComponent("shop").init();
|
||||
} else {
|
||||
// 非第一次使用,直接激活节点
|
||||
this.shopNode.active = true;
|
||||
|
|
|
@ -142,6 +142,11 @@ export default class NewClass extends cc.Component {
|
|||
}
|
||||
|
||||
start() {
|
||||
const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
|
||||
const jiazaiComp = jiazaiNode.getComponent(JiaZai);
|
||||
if (jiazaiComp) {
|
||||
jiazaiComp.getMonthlyCardValidityDays();
|
||||
}
|
||||
Utils.getMonthlyCard((data) => {
|
||||
if (data.msg == "不在有效期") {
|
||||
this.monthCardBtn.active = true;
|
||||
|
@ -149,6 +154,7 @@ export default class NewClass extends cc.Component {
|
|||
} else {
|
||||
this.monthCardBtn.active = false;
|
||||
this.monthCardBtn2.active = true;
|
||||
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ export default class NewClass extends cc.Component {
|
|||
this.stopPowerTime();
|
||||
this.updatePower();
|
||||
this.setHealthInfo(true);
|
||||
this.updateIcon();
|
||||
}
|
||||
//打开商店界面
|
||||
openShop() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user