增加 新方块功能

This commit is contained in:
COMPUTER\EDY 2026-01-05 14:33:36 +08:00
parent 51a36e7151
commit 03d1b35a0c
11 changed files with 1936 additions and 186 deletions

View File

@ -24212,7 +24212,8 @@
}, },
{ {
"__uuid__": "9e768017-b9e7-4003-94dc-2f90936f098f" "__uuid__": "9e768017-b9e7-4003-94dc-2f90936f098f"
} },
null
], ],
"liuGuang": null, "liuGuang": null,
"avatarUI": { "avatarUI": {

View File

@ -1007,7 +1007,7 @@ export default class Block extends cc.Component {
clearTimeout(this.scheduleCallback3); clearTimeout(this.scheduleCallback3);
let self = this; let self = this;
//锤子状态消失 //锤子状态消失
MapConroler._instance.pause = true; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = true;
if (MapConroler._instance.ismagic) { if (MapConroler._instance.ismagic) {
this.scheduleCallback = setTimeout(() => { this.scheduleCallback = setTimeout(() => {
@ -1121,7 +1121,7 @@ export default class Block extends cc.Component {
let self = this; let self = this;
this.isEliminatedByHammer = true; this.isEliminatedByHammer = true;
//锤子状态消失 //锤子状态消失
MapConroler._instance.pause = true; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = true;
if (MapConroler._instance.ishammer == true) { if (MapConroler._instance.ishammer == true) {
let parentSize = this.node.getContentSize(); let parentSize = this.node.getContentSize();
setTimeout(() => { setTimeout(() => {

View File

@ -237,10 +237,13 @@ export default class GameManager extends cc.Component {
if (data.data.onlyId) { if (data.data.onlyId) {
cc.fx.GameConfig.GM_INFO.userId = data.data.onlyId; cc.fx.GameConfig.GM_INFO.userId = data.data.onlyId;
} }
if (data.data.outTradeNo.length > 0) { if (data.data.outTradeNo) {
cc.fx.GameConfig.GM_INFO.allOutTradeNo = []; if (data.data.outTradeNo.length > 0) {
cc.fx.GameConfig.GM_INFO.allOutTradeNo = data.data.outTradeNo; cc.fx.GameConfig.GM_INFO.allOutTradeNo = [];
cc.fx.GameConfig.GM_INFO.allOutTradeNo = data.data.outTradeNo;
}
} }
if (data.data.shareLv) { if (data.data.shareLv) {
if (data.data.shareLv.length > 0) { if (data.data.shareLv.length > 0) {
cc.fx.GameConfig.GM_INFO.helpLevel = data.data.shareLv[0].lv; cc.fx.GameConfig.GM_INFO.helpLevel = data.data.shareLv[0].lv;
@ -251,8 +254,11 @@ export default class GameManager extends cc.Component {
} }
if (data.data.useravatar) { if (data.data.useravatar) {
cc.fx.GameConfig.GM_INFO.useravatarIcon = data.data.useravatar; cc.fx.GameConfig.GM_INFO.useravatarIcon = data.data.useravatar;
if (cc.fx.GameConfig.GM_INFO.useravatarIcon.length < 10) if (cc.fx.GameConfig.GM_INFO.useravatarIcon) {
cc.fx.GameConfig.GM_INFO.useravatarIcon = "icon_" + cc.fx.GameConfig.GM_INFO.useravatarIcon if (cc.fx.GameConfig.GM_INFO.useravatarIcon.length < 10)
cc.fx.GameConfig.GM_INFO.useravatarIcon = "icon_" + cc.fx.GameConfig.GM_INFO.useravatarIcon
}
} }
if (data.data.useravatarIcon) { if (data.data.useravatarIcon) {
cc.fx.GameConfig.GM_INFO.useravaterkuang = data.data.useravatarIcon; cc.fx.GameConfig.GM_INFO.useravaterkuang = data.data.useravatarIcon;

View File

@ -352,8 +352,10 @@ export default class JiaZai extends cc.Component {
cc.fx.GameTool.getHealth((data) => { cc.fx.GameTool.getHealth((data) => {
if (this.level) { if (this.level) {
NumberToImage.numberToImageNodesShop((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "custom", this.level, true); NumberToImage.numberToImageNodesShop((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "custom", this.level, true);
for (let i = 0; i < this.level.children.length; i++) { if (this.level.children) {
this.level.children[i].color = cc.Color.BLACK; for (let i = 0; i < this.level.children.length; i++) {
this.level.children[i].color = cc.Color.BLACK;
}
} }
} }
if (this.coin) { if (this.coin) {
@ -388,8 +390,10 @@ export default class JiaZai extends cc.Component {
cc.fx.GameTool.getHealth((data) => { cc.fx.GameTool.getHealth((data) => {
NumberToImage.numberToImageNodesShop((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "custom", this.level, true); NumberToImage.numberToImageNodesShop((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "custom", this.level, true);
for (let i = 0; i < this.level.children.length; i++) { if (this.level.children) {
this.level.children[i].color = cc.Color.BLACK; for (let i = 0; i < this.level.children.length; i++) {
this.level.children[i].color = cc.Color.BLACK;
}
} }
NumberToImage.numberToImageNodes5(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "Black", this.coin, true); NumberToImage.numberToImageNodes5(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "Black", this.coin, true);
this.setHealthInfo(true); this.setHealthInfo(true);
@ -611,22 +615,25 @@ export default class JiaZai extends cc.Component {
console.log("最终头像框:", cc.fx.GameConfig.GM_INFO.useravaterkuang); console.log("最终头像框:", cc.fx.GameConfig.GM_INFO.useravaterkuang);
let top = this.node.getChildByName("Load").getChildByName("Top"); let top = this.node.getChildByName("Load").getChildByName("Top");
if (this.AvatarNode) this.AvatarNode.active = false; if (this.AvatarNode) this.AvatarNode.active = false;
if (cc.fx.GameConfig.GM_INFO.useravatarIcon.length > 10) { if (cc.fx.GameConfig.GM_INFO.useravatarIcon) {
console.log("获取头像链接:", cc.fx.GameConfig.GM_INFO.useravatarIcon); if (cc.fx.GameConfig.GM_INFO.useravatarIcon.length > 10) {
cc.assetManager.loadRemote(cc.fx.GameConfig.GM_INFO.useravatarIcon, { ext: '.png' }, (err, texture: cc.Texture2D) => { console.log("获取头像链接:", cc.fx.GameConfig.GM_INFO.useravatarIcon);
if (texture) { cc.assetManager.loadRemote(cc.fx.GameConfig.GM_INFO.useravatarIcon, { ext: '.png' }, (err, texture: cc.Texture2D) => {
top.getChildByName("avatar").getChildByName("avatar").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture); if (texture) {
} top.getChildByName("avatar").getChildByName("avatar").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}
top.getChildByName("avatar").opacity = 255;
top.getChildByName("kuang1").opacity = 255;
})
} else {
top.getChildByName("avatar").getChildByName("avatar").getComponent(cc.Sprite).spriteFrame =
this.avatarUI.getSpriteFrame(cc.fx.GameConfig.GM_INFO.useravatarIcon);
top.getChildByName("avatar").opacity = 255; top.getChildByName("avatar").opacity = 255;
top.getChildByName("kuang1").opacity = 255; top.getChildByName("kuang1").opacity = 255;
}) }
} else {
top.getChildByName("avatar").getChildByName("avatar").getComponent(cc.Sprite).spriteFrame =
this.avatarUI.getSpriteFrame(cc.fx.GameConfig.GM_INFO.useravatarIcon);
top.getChildByName("avatar").opacity = 255;
top.getChildByName("kuang1").opacity = 255;
} }
top.getChildByName("kuang").getComponent(cc.Sprite).spriteFrame = top.getChildByName("kuang").getComponent(cc.Sprite).spriteFrame =
this.avatarUI.getSpriteFrame(cc.fx.GameConfig.GM_INFO.useravaterkuang); this.avatarUI.getSpriteFrame(cc.fx.GameConfig.GM_INFO.useravaterkuang);
top.getChildByName("kuang").opacity = 255; top.getChildByName("kuang").opacity = 255;
@ -781,20 +788,22 @@ export default class JiaZai extends cc.Component {
this.scheduleCallback2 = function () { this.scheduleCallback2 = function () {
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) {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
this.stopPowerTime(); this.stopPowerTime();
this.setHealthInfo(true); this.setHealthInfo(true);
return; return;
} }
else { else {
this.Stamina.getChildByName("skyLine").active = true; if (this.Stamina) {
this.Stamina.getChildByName("time").opacity = 0; this.Stamina.getChildByName("skyLine").active = true;
this.Stamina.getChildByName("man").active = false; this.Stamina.getChildByName("time").opacity = 0;
this.Stamina.getChildByName("man").active = false;
}
} }
let time = cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime; let time = cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime;
if (time <= 0) { if (time <= 0) {
time = 0; time = 0;
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
this.stopPowerTime(); this.stopPowerTime();
this.setHealthInfo(true); this.setHealthInfo(true);
var timeTemp = cc.fx.GameTool.getTimeMargin2(time); var timeTemp = cc.fx.GameTool.getTimeMargin2(time);
@ -845,35 +854,44 @@ export default class JiaZai extends cc.Component {
this.stopPowerTime(); this.stopPowerTime();
this.startPowerTime(); this.startPowerTime();
//console.log("还有无限体力时间_____________", (cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime)); //console.log("还有无限体力时间_____________", (cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime));
this.Stamina.getChildByName("skyLine").active = true; if (this.Stamina) {
this.Stamina.getChildByName("time").opacity = 0; this.Stamina.getChildByName("skyLine").active = true;
this.Stamina.getChildByName("man").active = false; this.Stamina.getChildByName("time").opacity = 0;
this.Stamina.getChildByName("man").active = false;
}
} }
else { else {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) {
//console.log("无限体力时间已过期"); this.Stamina.getChildByName("skyLine").active = false;
this.Stamina.getChildByName("man").active = true; //console.log("无限体力时间已过期");
this.Stamina.getChildByName("man").active = true;
}
} }
} }
else { else {
this.Stamina.getChildByName("man").active = true; if (this.Stamina) this.Stamina.getChildByName("man").active = true;
}
if (this.Stamina) {
this.Stamina.getChildByName("health").active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false);
this.Stamina.getChildByName("time").active = false;
} }
this.Stamina.getChildByName("health").active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false);
this.Stamina.getChildByName("time").active = false;
} }
else { else {
this.Stamina.getChildByName("man").active = false; if (this.Stamina) {
this.Stamina.getChildByName("health").active = true; this.Stamina.getChildByName("man").active = false;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false); this.Stamina.getChildByName("health").active = true;
this.Stamina.getChildByName("time").active = true; NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false);
this.Stamina.getChildByName("time").active = true;
}
if (cc.fx.GameConfig.GM_INFO.min_Time != 0) { if (cc.fx.GameConfig.GM_INFO.min_Time != 0) {
let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
this.Stamina.getChildByName("time").getComponent(cc.Label).string = time; if (this.Stamina) {
let power = cc.fx.GameTool.getUserPowerTime(); this.Stamina.getChildByName("time").getComponent(cc.Label).string = time;
if (!power) this.Stamina.getChildByName("time").opacity = 255; let power = cc.fx.GameTool.getUserPowerTime();
else this.Stamina.getChildByName("time").opacity = 0; if (!power) this.Stamina.getChildByName("time").opacity = 255;
else this.Stamina.getChildByName("time").opacity = 0;
}
// console.log("______________________启动计时器"); // console.log("______________________启动计时器");
this.stopTimeCutDown(); this.stopTimeCutDown();
this.startTimeCutDown(); this.startTimeCutDown();
@ -1276,106 +1294,109 @@ export default class JiaZai extends cc.Component {
} catch (e) { } catch (e) {
console.error('获取系统信息失败', e); console.error('获取系统信息失败', e);
} }
if (cc.fx.GameConfig.GM_INFO.allOutTradeNo.length != 0) { if (cc.fx.GameConfig.GM_INFO.allOutTradeNo) {
console.log("有需要补发数据", cc.fx.GameConfig.GM_INFO.allOutTradeNo); if (cc.fx.GameConfig.GM_INFO.allOutTradeNo.length != 0) {
console.log("有需要补发数据", cc.fx.GameConfig.GM_INFO.allOutTradeNo);
// 递归函数,按顺序处理每个订单 // 递归函数,按顺序处理每个订单
const processOrder = (index: number) => { const processOrder = (index: number) => {
if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) { if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) {
return; // 所有订单处理完成 return; // 所有订单处理完成
} }
let order = cc.fx.GameConfig.GM_INFO.allOutTradeNo[index]; let order = cc.fx.GameConfig.GM_INFO.allOutTradeNo[index];
console.log("需要补发数据", order); console.log("需要补发数据", order);
if (order.itemid == "gold_1" || order.itemid == "gold_2" || order.itemid == "gold_3" if (order.itemid == "gold_1" || order.itemid == "gold_2" || order.itemid == "gold_3"
|| order.itemid == "gold_4" || order.itemid == "gold_5" || order.itemid == "gold_6" || order.itemid == "gold_4" || order.itemid == "gold_5" || order.itemid == "gold_6"
|| order.itemid == "unlimited_health_bundle_10" || order.itemid == "unlimited_health_bundle_20" || order.itemid == "unlimited_health_bundle_10" || order.itemid == "unlimited_health_bundle_20"
|| order.itemid == "unlimited_health_bundle_30" || order.itemid == "month_Card" || "reborn_Gift" || order.itemid == "unlimited_health_bundle_30" || order.itemid == "month_Card" || "reborn_Gift"
|| order.itemid == "starter_pack" || order.itemid == "battlepass" || order.itemid == "starter_pack" || order.itemid == "battlepass"
) { ) {
this.openLoad(); this.openLoad();
console.log("补发名称:", order.itemid); console.log("补发名称:", order.itemid);
let productId = order.itemid; let productId = order.itemid;
Utils.setPayInfo( Utils.setPayInfo(
(res) => { (res) => {
console.log("设置轮训结果:", res); console.log("设置轮训结果:", res);
this.closeLoad(); this.closeLoad();
if (res.code === 1) { if (res.code === 1) {
console.log("7.14_________正式发货"); console.log("7.14_________正式发货");
let coinTemp = 0; let coinTemp = 0;
if (order.itemid == "gold_1") { coinTemp = 1200; } if (order.itemid == "gold_1") { coinTemp = 1200; }
else if (order.itemid == "gold_2") { coinTemp = 8000; } else if (order.itemid == "gold_2") { coinTemp = 8000; }
else if (order.itemid == "gold_3") { coinTemp = 16000; } else if (order.itemid == "gold_3") { coinTemp = 16000; }
else if (order.itemid == "gold_4") { coinTemp = 32000; } else if (order.itemid == "gold_4") { coinTemp = 32000; }
else if (order.itemid == "gold_5") { coinTemp = 100000; } else if (order.itemid == "gold_5") { coinTemp = 100000; }
else if (order.itemid == "gold_6") { coinTemp = 240000; } else if (order.itemid == "gold_6") { coinTemp = 240000; }
else if (order.itemid == "unlimited_health_bundle_10") { coinTemp = 2500; } else if (order.itemid == "unlimited_health_bundle_10") { coinTemp = 2500; }
else if (order.itemid == "unlimited_health_bundle_20") { coinTemp = 5000; } else if (order.itemid == "unlimited_health_bundle_20") { coinTemp = 5000; }
else if (order.itemid == "unlimited_health_bundle_30") { coinTemp = 7500; } else if (order.itemid == "unlimited_health_bundle_30") { coinTemp = 7500; }
else if (order.itemid == "month_Card") { else if (order.itemid == "month_Card") {
coinTemp = 6000; coinTemp = 6000;
cc.fx.GameConfig.GM_INFO.doubleCoin = 2; cc.fx.GameConfig.GM_INFO.doubleCoin = 2;
cc.fx.GameConfig.GM_INFO.hp_Max = 7; cc.fx.GameConfig.GM_INFO.hp_Max = 7;
cc.fx.GameConfig.GM_INFO.hp = 7; cc.fx.GameConfig.GM_INFO.hp = 7;
this.openLoad(); this.openLoad();
this.buyMonthCard(productId); this.buyMonthCard(productId);
} }
else if (order.itemid == "reborn_Gift") { else if (order.itemid == "reborn_Gift") {
coinTemp = 1000; coinTemp = 1000;
} }
else if (order.itemid == "starter_pack") { else if (order.itemid == "starter_pack") {
coinTemp = 3000; coinTemp = 3000;
cc.fx.GameConfig.GM_INFO.doubleCoin = 5; cc.fx.GameConfig.GM_INFO.doubleCoin = 5;
cc.fx.GameConfig.GM_INFO.hp_Max = 5; cc.fx.GameConfig.GM_INFO.hp_Max = 5;
cc.fx.GameConfig.GM_INFO.hp = 5; cc.fx.GameConfig.GM_INFO.hp = 5;
} else if (order.itemid == "battlepass") { } else if (order.itemid == "battlepass") {
// 通行证订单 // 通行证订单
this.reissuePaaCheck(); this.reissuePaaCheck();
} }
let title = "充值补发奖励金币:" + coinTemp; let title = "充值补发奖励金币:" + coinTemp;
// MiniGameSdk.API.showToast(title); // MiniGameSdk.API.showToast(title);
if (order.itemid != "month_Card") cc.fx.GameTool.shopBuy(productId, true); if (order.itemid != "month_Card") cc.fx.GameTool.shopBuy(productId, true);
console.log("充值成功获得金币"); console.log("充值成功获得金币");
let price = parseInt(order.goodsPrice) || 0; let price = parseInt(order.goodsPrice) || 0;
// const dataSuccess = { // const dataSuccess = {
// outTradeNo: order.outTradeNo, // outTradeNo: order.outTradeNo,
// pay_amount: price, // pay_amount: price,
// payment_name: productId, // payment_name: productId,
// payment_num: 1, // payment_num: 1,
// type: systemType, // type: systemType,
// } // }
let name = "补发充值成功" + productId; let name = "补发充值成功" + productId;
// cc.fx.GameTool.shushu_Track("payment", dataSuccess); // cc.fx.GameTool.shushu_Track("payment", dataSuccess);
// console.log("引力付费透传", price, order.outTradeNo, name); // console.log("引力付费透传", price, order.outTradeNo, name);
MiniGameSdk.API.yinli_Pay(price, order.outTradeNo, name); MiniGameSdk.API.yinli_Pay(price, order.outTradeNo, name);
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: order.outTradeNo,
pay_amount: parseInt(order.goodsPrice) || 0,
payment_name: productId,
payment_num: 1,
type: systemType,
fail_reason: "成功付款,但是发货时请求服务器失败,重新进入游戏后轮训发货又失败",
} }
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4); else {
} MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
NumberToImage.numberToImageNodes5(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "Black", this.coin, true); const dataFail4 = {
this.updateCoin(); outTradeNo: order.outTradeNo,
// 处理下一个订单 pay_amount: parseInt(order.goodsPrice) || 0,
processOrder(index + 1); payment_name: productId,
}, order.outTradeNo); payment_num: 1,
} else { type: systemType,
// 如果当前订单不处理,直接处理下一个订单 fail_reason: "成功付款,但是发货时请求服务器失败,重新进入游戏后轮训发货又失败",
processOrder(index + 1); }
} cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
}; }
NumberToImage.numberToImageNodes5(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "Black", this.coin, true);
this.updateCoin();
// 处理下一个订单
processOrder(index + 1);
}, order.outTradeNo);
} else {
// 如果当前订单不处理,直接处理下一个订单
processOrder(index + 1);
}
};
// 从第一个订单开始处理 // 从第一个订单开始处理
processOrder(0); processOrder(0);
}
} }
} }
} }
@ -1406,21 +1427,25 @@ export default class JiaZai extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.userPowerTime > nowTime) { if (cc.fx.GameConfig.GM_INFO.userPowerTime > nowTime) {
this.stopPowerTime(); this.stopPowerTime();
this.startPowerTime(); this.startPowerTime();
//("还有无限体力时间_____________", (cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime)); if (this.Stamina) {
this.Stamina.getChildByName("skyLine").active = true; //("还有无限体力时间_____________", (cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime));
this.Stamina.getChildByName("time").opacity = 0; this.Stamina.getChildByName("skyLine").active = true;
this.Stamina.getChildByName("man").active = false; this.Stamina.getChildByName("time").opacity = 0;
this.Stamina.getChildByName("man").active = false;
}
} }
else { else {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
//console.log("无限体力时间已过期"); //console.log("无限体力时间已过期");
this.setHealthInfo(true); this.setHealthInfo(true);
} }
} }
else { else {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) {
this.Stamina.getChildByName("time").opacity = 255; this.Stamina.getChildByName("skyLine").active = false;
this.Stamina.getChildByName("man").active = true; this.Stamina.getChildByName("time").opacity = 255;
this.Stamina.getChildByName("man").active = true;
}
//console.log("没有无限体力时间"); //console.log("没有无限体力时间");
this.setHealthInfo(true); this.setHealthInfo(true);
} }
@ -1822,9 +1847,12 @@ export default class JiaZai extends cc.Component {
}; };
cc.fx.StorageMessage.setStorage("level", levelInfo); cc.fx.StorageMessage.setStorage("level", levelInfo);
NumberToImage.numberToImageNodesShop((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "custom", this.level, true); NumberToImage.numberToImageNodesShop((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "custom", this.level, true);
for (let i = 0; i < this.level.children.length; i++) { if (this.level.children) {
this.level.children[i].color = cc.Color.BLACK; for (let i = 0; i < this.level.children.length; i++) {
this.level.children[i].color = cc.Color.BLACK;
}
} }
Utils.setUserLevel((data) => { Utils.setUserLevel((data) => {
}) })
} }

View File

@ -352,7 +352,7 @@ export default class SceneManager extends cc.Component {
.start(); .start();
MapConroler._instance.pause = true; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = true;
MapConroler._instance.stopBoom(); MapConroler._instance.stopBoom();
} }
} }
@ -362,7 +362,7 @@ export default class SceneManager extends cc.Component {
this.shopNode.active = false; this.shopNode.active = false;
var pause = MapConroler._instance.iceTrue(); var pause = MapConroler._instance.iceTrue();
if (pause == false) { if (pause == false) {
MapConroler._instance.pause = false; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = false;
if (MapConroler._instance.gameStart == true) MapConroler._instance.startBoom(); if (MapConroler._instance.gameStart == true) MapConroler._instance.startBoom();
} }
} }
@ -374,13 +374,13 @@ export default class SceneManager extends cc.Component {
this.node.getChildByName("Pause").active = false; this.node.getChildByName("Pause").active = false;
var pause = MapConroler._instance.iceTrue(); var pause = MapConroler._instance.iceTrue();
if (pause == false) { if (pause == false) {
MapConroler._instance.pause = false; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = false;
if (MapConroler._instance.gameStart == true) MapConroler._instance.startBoom(); if (MapConroler._instance.gameStart == true) MapConroler._instance.startBoom();
} }
} }
openPropBuy(name) { openPropBuy(name) {
MapConroler._instance.pause = true; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = true;
MapConroler._instance.stopBoom(); MapConroler._instance.stopBoom();
this.btnName = name; this.btnName = name;
@ -458,7 +458,7 @@ export default class SceneManager extends cc.Component {
} }
cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo);
cc.fx.GameConfig.GM_INFO.shopDouble = res.data.shopDouble; cc.fx.GameConfig.GM_INFO.shopDouble = res.data.shopDouble;
MapConroler._instance.pause = true; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = true;
MapConroler._instance.stopBoom(); MapConroler._instance.stopBoom();
if (!this.shopNode) { if (!this.shopNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
@ -525,7 +525,7 @@ export default class SceneManager extends cc.Component {
else { else {
var pause = MapConroler._instance.iceTrue(); var pause = MapConroler._instance.iceTrue();
if (pause == false) { if (pause == false) {
MapConroler._instance.pause = false; if (MapConroler && MapConroler._instance) MapConroler._instance.pause = false;
if (MapConroler._instance.gameStart == true) MapConroler._instance.startBoom(); if (MapConroler._instance.gameStart == true) MapConroler._instance.startBoom();
} }
} }

View File

@ -1435,10 +1435,10 @@ export default class Utils {
console.log("_______________s:", setData); console.log("_______________s:", setData);
Utils.POST("getAddressRank", setData, res => { Utils.POST("getAddressRank", setData, res => {
if (res.code === 1) { if (res.code === 1) {
console.log("1设置城市信息成功", res); // console.log("1设置城市信息成功", res);
if (callBack) callBack(res); if (callBack) callBack(res);
} else { } else {
console.log("1设置城市信息失败", res); // console.log("1设置城市信息失败", res);
} }
}) })

View File

@ -0,0 +1,620 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>frames</key>
<dict>
<key>11color0.png</key>
<dict>
<key>frame</key>
<string>{{128,1878},{124,132}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{124,132}}</string>
<key>sourceSize</key>
<string>{124,132}</string>
</dict>
<key>11color1.png</key>
<dict>
<key>frame</key>
<string>{{1624,255},{251,128}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{251,128}}</string>
<key>sourceSize</key>
<string>{251,128}</string>
</dict>
<key>11color10.png</key>
<dict>
<key>frame</key>
<string>{{374,376},{247,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{247,372}}</string>
<key>sourceSize</key>
<string>{247,372}</string>
</dict>
<key>11color11.png</key>
<dict>
<key>frame</key>
<string>{{1128,374},{368,255}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{368,255}}</string>
<key>sourceSize</key>
<string>{368,255}</string>
</dict>
<key>11color12.png</key>
<dict>
<key>frame</key>
<string>{{870,2},{250,371}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{250,371}}</string>
<key>sourceSize</key>
<string>{250,371}</string>
</dict>
<key>11color13.png</key>
<dict>
<key>frame</key>
<string>{{1137,744},{364,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{364,252}}</string>
<key>sourceSize</key>
<string>{364,252}</string>
</dict>
<key>11color14.png</key>
<dict>
<key>frame</key>
<string>{{253,1502},{372,248}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{372,248}}</string>
<key>sourceSize</key>
<string>{372,248}</string>
</dict>
<key>11color15.png</key>
<dict>
<key>frame</key>
<string>{{628,1121},{370,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{370,251}}</string>
<key>sourceSize</key>
<string>{370,251}</string>
</dict>
<key>11color16.png</key>
<dict>
<key>frame</key>
<string>{{623,2},{245,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{245,372}}</string>
<key>sourceSize</key>
<string>{245,372}</string>
</dict>
<key>11color17.png</key>
<dict>
<key>frame</key>
<string>{{374,2},{247,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{247,372}}</string>
<key>sourceSize</key>
<string>{247,372}</string>
</dict>
<key>11color18.png</key>
<dict>
<key>frame</key>
<string>{{2,378},{370,374}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{370,374}}</string>
<key>sourceSize</key>
<string>{370,374}</string>
</dict>
<key>11color19.png</key>
<dict>
<key>frame</key>
<string>{{1755,752},{250,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{250,251}}</string>
<key>sourceSize</key>
<string>{250,251}</string>
</dict>
<key>11color2.png</key>
<dict>
<key>frame</key>
<string>{{1385,372},{128,256}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{128,256}}</string>
<key>sourceSize</key>
<string>{128,256}</string>
</dict>
<key>11color20.png</key>
<dict>
<key>frame</key>
<string>{{1755,251},{247,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{247,252}}</string>
<key>sourceSize</key>
<string>{247,252}</string>
</dict>
<key>11color21.png</key>
<dict>
<key>frame</key>
<string>{{1258,1740},{248,255}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{248,255}}</string>
<key>sourceSize</key>
<string>{248,255}</string>
</dict>
<key>11color22.png</key>
<dict>
<key>frame</key>
<string>{{1504,1364},{249,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{249,252}}</string>
<key>sourceSize</key>
<string>{249,252}</string>
</dict>
<key>11color3.png</key>
<dict>
<key>frame</key>
<string>{{627,1876},{371,130}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{371,130}}</string>
<key>sourceSize</key>
<string>{371,130}</string>
</dict>
<key>11color4.png</key>
<dict>
<key>frame</key>
<string>{{2,1129},{125,373}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{125,373}}</string>
<key>sourceSize</key>
<string>{125,373}</string>
</dict>
<key>11color5.png</key>
<dict>
<key>frame</key>
<string>{{1755,1254},{251,248}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{251,248}}</string>
<key>sourceSize</key>
<string>{251,248}</string>
</dict>
<key>11color6.png</key>
<dict>
<key>frame</key>
<string>{{129,754},{249,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{249,372}}</string>
<key>sourceSize</key>
<string>{249,372}</string>
</dict>
<key>11color7.png</key>
<dict>
<key>frame</key>
<string>{{881,1117},{367,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{367,252}}</string>
<key>sourceSize</key>
<string>{367,252}</string>
</dict>
<key>11color8.png</key>
<dict>
<key>frame</key>
<string>{{752,1493},{247,368}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{247,368}}</string>
<key>sourceSize</key>
<string>{247,368}</string>
</dict>
<key>11color9.png</key>
<dict>
<key>frame</key>
<string>{{1122,2},{370,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{370,251}}</string>
<key>sourceSize</key>
<string>{370,251}</string>
</dict>
<key>12color0.png</key>
<dict>
<key>frame</key>
<string>{{2,1878},{124,132}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{124,132}}</string>
<key>sourceSize</key>
<string>{124,132}</string>
</dict>
<key>12color1.png</key>
<dict>
<key>frame</key>
<string>{{1624,2},{251,128}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{251,128}}</string>
<key>sourceSize</key>
<string>{251,128}</string>
</dict>
<key>12color10.png</key>
<dict>
<key>frame</key>
<string>{{503,1502},{247,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{247,372}}</string>
<key>sourceSize</key>
<string>{247,372}</string>
</dict>
<key>12color11.png</key>
<dict>
<key>frame</key>
<string>{{880,747},{368,255}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{368,255}}</string>
<key>sourceSize</key>
<string>{368,255}</string>
</dict>
<key>12color12.png</key>
<dict>
<key>frame</key>
<string>{{623,376},{250,371}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{250,371}}</string>
<key>sourceSize</key>
<string>{250,371}</string>
</dict>
<key>12color13.png</key>
<dict>
<key>frame</key>
<string>{{1135,1117},{364,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{364,252}}</string>
<key>sourceSize</key>
<string>{364,252}</string>
</dict>
<key>12color14.png</key>
<dict>
<key>frame</key>
<string>{{129,1128},{372,248}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{372,248}}</string>
<key>sourceSize</key>
<string>{372,248}</string>
</dict>
<key>12color15.png</key>
<dict>
<key>frame</key>
<string>{{875,375},{370,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{370,251}}</string>
<key>sourceSize</key>
<string>{370,251}</string>
</dict>
<key>12color16.png</key>
<dict>
<key>frame</key>
<string>{{380,750},{245,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{245,372}}</string>
<key>sourceSize</key>
<string>{245,372}</string>
</dict>
<key>12color17.png</key>
<dict>
<key>frame</key>
<string>{{379,1128},{247,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{247,372}}</string>
<key>sourceSize</key>
<string>{247,372}</string>
</dict>
<key>12color18.png</key>
<dict>
<key>frame</key>
<string>{{2,2},{370,374}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{370,374}}</string>
<key>sourceSize</key>
<string>{370,374}</string>
</dict>
<key>12color19.png</key>
<dict>
<key>frame</key>
<string>{{1755,500},{250,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{250,251}}</string>
<key>sourceSize</key>
<string>{250,251}</string>
</dict>
<key>12color2.png</key>
<dict>
<key>frame</key>
<string>{{1000,1863},{128,256}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{128,256}}</string>
<key>sourceSize</key>
<string>{128,256}</string>
</dict>
<key>12color20.png</key>
<dict>
<key>frame</key>
<string>{{1755,2},{247,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{247,252}}</string>
<key>sourceSize</key>
<string>{247,252}</string>
</dict>
<key>12color21.png</key>
<dict>
<key>frame</key>
<string>{{1254,1483},{248,255}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{248,255}}</string>
<key>sourceSize</key>
<string>{248,255}</string>
</dict>
<key>12color22.png</key>
<dict>
<key>frame</key>
<string>{{1389,1110},{249,252}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{249,252}}</string>
<key>sourceSize</key>
<string>{249,252}</string>
</dict>
<key>12color3.png</key>
<dict>
<key>frame</key>
<string>{{254,1876},{371,130}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{371,130}}</string>
<key>sourceSize</key>
<string>{371,130}</string>
</dict>
<key>12color4.png</key>
<dict>
<key>frame</key>
<string>{{2,754},{125,373}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{125,373}}</string>
<key>sourceSize</key>
<string>{125,373}</string>
</dict>
<key>12color5.png</key>
<dict>
<key>frame</key>
<string>{{1755,1004},{251,248}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{251,248}}</string>
<key>sourceSize</key>
<string>{251,248}</string>
</dict>
<key>12color6.png</key>
<dict>
<key>frame</key>
<string>{{2,1504},{249,372}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{249,372}}</string>
<key>sourceSize</key>
<string>{249,372}</string>
</dict>
<key>12color7.png</key>
<dict>
<key>frame</key>
<string>{{1001,1486},{367,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{367,251}}</string>
<key>sourceSize</key>
<string>{367,251}</string>
</dict>
<key>12color8.png</key>
<dict>
<key>frame</key>
<string>{{1375,2},{247,368}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{247,368}}</string>
<key>sourceSize</key>
<string>{247,368}</string>
</dict>
<key>12color9.png</key>
<dict>
<key>frame</key>
<string>{{627,749},{370,251}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{370,251}}</string>
<key>sourceSize</key>
<string>{370,251}</string>
</dict>
</dict>
<key>metadata</key>
<dict>
<key>format</key>
<integer>2</integer>
<key>realTextureFileName</key>
<string>block7.png</string>
<key>size</key>
<string>{2048,2048}</string>
<key>smartupdate</key>
<string>$TexturePacker:SmartUpdate:9fb9c6e2d7ec59c8a227c1b26407d2a4$</string>
<key>textureFileName</key>
<string>block7.png</string>
</dict>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

View File

@ -0,0 +1,15 @@
{
"ver": "2.3.7",
"uuid": "3f42bcd7-c693-416d-a6ed-2717160493a8",
"importer": "texture",
"type": "raw",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {}
}

View File

@ -370,11 +370,11 @@ export default class NewClass extends cc.Component {
} }
setHealthInfo(type) { setHealthInfo(type) {
if (cc.fx.GameConfig.GM_INFO.hp >= cc.fx.GameConfig.GM_INFO.hp_Max) { if (cc.fx.GameConfig.GM_INFO.hp >= cc.fx.GameConfig.GM_INFO.hp_Max && this.Stamina) {
this.Stamina.getChildByName("man").active = true; this.Stamina.getChildByName("man").active = true;
this.Stamina.getChildByName("health").active = true; this.Stamina.getChildByName("health").active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false);
this.Stamina.getChildByName("time").active = false; this.Stamina.getChildByName("time").active = false;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false);
} }
else { else {
const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点 const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点
@ -384,34 +384,39 @@ export default class NewClass extends cc.Component {
MapConroler._instance.setPropNum(); MapConroler._instance.setPropNum();
console.log("局内"); console.log("局内");
cc.fx.GameTool.getHealth((data) => { cc.fx.GameTool.getHealth((data) => {
this.Stamina.getChildByName("time").active = true; if (this.Stamina) this.Stamina.getChildByName("time").active = true;
if (cc.fx.GameConfig.GM_INFO.min_Time != 0) { if (cc.fx.GameConfig.GM_INFO.min_Time != 0) {
let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
this.Stamina.getChildByName("time").getComponent(cc.Label).string = time; if (this.Stamina) {
let power = cc.fx.GameTool.getUserPowerTime(); this.Stamina.getChildByName("time").getComponent(cc.Label).string = time;
if (!power) this.Stamina.getChildByName("time").opacity = 255; let power = cc.fx.GameTool.getUserPowerTime();
else this.Stamina.getChildByName("time").opacity = 0; if (!power) this.Stamina.getChildByName("time").opacity = 255;
else this.Stamina.getChildByName("time").opacity = 0;
}
this.stopTimeCutDown(); this.stopTimeCutDown();
this.startTimeCutDown(); this.startTimeCutDown();
} }
}); });
} else { } else {
this.Stamina.getChildByName("time").active = true; if (this.Stamina) this.Stamina.getChildByName("time").active = true;
if (cc.fx.GameConfig.GM_INFO.min_Time != 0) { if (cc.fx.GameConfig.GM_INFO.min_Time != 0) {
let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
this.Stamina.getChildByName("time").getComponent(cc.Label).string = time; if (this.Stamina) {
let power = cc.fx.GameTool.getUserPowerTime(); this.Stamina.getChildByName("time").getComponent(cc.Label).string = time;
if (!power) this.Stamina.getChildByName("time").opacity = 255; let power = cc.fx.GameTool.getUserPowerTime();
else this.Stamina.getChildByName("time").opacity = 0; if (!power) this.Stamina.getChildByName("time").opacity = 255;
else this.Stamina.getChildByName("time").opacity = 0;
}
this.stopTimeCutDown(); this.stopTimeCutDown();
this.startTimeCutDown(); this.startTimeCutDown();
} }
} }
} }
if (this.Stamina) {
this.Stamina.getChildByName("man").active = false; this.Stamina.getChildByName("man").active = false;
this.Stamina.getChildByName("health").active = true; this.Stamina.getChildByName("health").active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false);
}
} }
} }
@ -711,18 +716,20 @@ export default class NewClass extends cc.Component {
this.stopPowerTime(); this.stopPowerTime();
this.startPowerTime(); this.startPowerTime();
console.log("还有无限体力时间_____________", (cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime)); console.log("还有无限体力时间_____________", (cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime));
this.Stamina.getChildByName("skyLine").active = true; if (this.Stamina) {
this.Stamina.getChildByName("time").opacity = 0; this.Stamina.getChildByName("skyLine").active = true;
this.Stamina.getChildByName("man").active = false; this.Stamina.getChildByName("time").opacity = 0;
this.Stamina.getChildByName("man").active = false;
}
} }
else { else {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
console.log("无限体力时间已过期"); console.log("无限体力时间已过期");
this.setHealthInfo(true); this.setHealthInfo(true);
} }
} }
else { else {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
this.setHealthInfo(true); this.setHealthInfo(true);
console.log("没有无限体力时间"); console.log("没有无限体力时间");
} }
@ -733,20 +740,22 @@ export default class NewClass extends cc.Component {
this.scheduleCallback2 = function () { this.scheduleCallback2 = function () {
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) {
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
this.stopPowerTime(); this.stopPowerTime();
this.setHealthInfo(true); this.setHealthInfo(true);
return; return;
} }
else { else {
this.Stamina.getChildByName("skyLine").active = true; if (this.Stamina) {
this.Stamina.getChildByName("time").opacity = 0; this.Stamina.getChildByName("skyLine").active = true;
this.Stamina.getChildByName("man").active = false; this.Stamina.getChildByName("time").opacity = 0;
this.Stamina.getChildByName("man").active = false;
}
} }
let time = cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime; let time = cc.fx.GameConfig.GM_INFO.userPowerTime - nowTime;
if (time <= 0) { if (time <= 0) {
time = 0; time = 0;
this.Stamina.getChildByName("skyLine").active = false; if (this.Stamina) this.Stamina.getChildByName("skyLine").active = false;
this.stopPowerTime(); this.stopPowerTime();
this.setHealthInfo(true); this.setHealthInfo(true);
var timeTemp = cc.fx.GameTool.getTimeMargin2(time); var timeTemp = cc.fx.GameTool.getTimeMargin2(time);