Compare commits

...

2 Commits

Author SHA1 Message Date
COMPUTER\EDY 719a170c85 更新 2026-01-09 15:52:33 +08:00
COMPUTER\EDY b747bac58b 日常更新 2026-01-09 14:35:17 +08:00
11 changed files with 573 additions and 434 deletions

View File

@ -17,7 +17,7 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 1182 "__id__": 1187
} }
], ],
"_active": false, "_active": false,
@ -84,25 +84,25 @@
"__id__": 1037 "__id__": 1037
}, },
{ {
"__id__": 1159 "__id__": 1164
}, },
{ {
"__id__": 1172 "__id__": 1177
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1178 "__id__": 1183
}, },
{ {
"__id__": 1179 "__id__": 1184
}, },
{ {
"__id__": 1180 "__id__": 1185
}, },
{ {
"__id__": 1181 "__id__": 1186
} }
], ],
"_prefab": null, "_prefab": null,
@ -49113,12 +49113,15 @@
}, },
{ {
"__id__": 1123 "__id__": 1123
},
{
"__id__": 1158
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 1158 "__id__": 1163
} }
], ],
"_prefab": null, "_prefab": null,
@ -54879,6 +54882,217 @@
"_originalHeight": 1920, "_originalHeight": 1920,
"_id": "73AcxN4iVLWadelL+ShqIS" "_id": "73AcxN4iVLWadelL+ShqIS"
}, },
{
"__type__": "cc.Node",
"_name": "share",
"_objFlags": 0,
"_parent": {
"__id__": 1037
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1159
},
{
"__id__": 1160
},
{
"__id__": 1161
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 608,
"height": 122
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-780,
0,
0,
0,
0,
1,
1,
1,
0
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b7ky+hHi1MC7xa7s9UZjpO"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1158
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6b170755-619c-4323-9ec4-5ff07e004765"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "77b8GrOldKoJoB8T4Srr7+"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1158
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 485.8,
"_right": -304,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "4bj20HkMtOVLODhBArim04"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1158
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 1162
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1158
},
"_id": "a0K19zgBNDpaq71mWiEama"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "80998T1AYNNRZdRxsVvXR65",
"handler": "shareFriend",
"customEventData": ""
},
{ {
"__type__": "19d952d5kVBrLSzAIGeElFK", "__type__": "19d952d5kVBrLSzAIGeElFK",
"_name": "", "_name": "",
@ -54913,23 +55127,23 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 1160 "__id__": 1165
}, },
{ {
"__id__": 1164 "__id__": 1169
}, },
{ {
"__id__": 1167 "__id__": 1172
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 1170 "__id__": 1175
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1171 "__id__": 1176
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -54983,20 +55197,20 @@
"_name": "New Sprite(Splash)", "_name": "New Sprite(Splash)",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1159 "__id__": 1164
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1161 "__id__": 1166
}, },
{ {
"__id__": 1162 "__id__": 1167
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1163 "__id__": 1168
}, },
"_opacity": 120, "_opacity": 120,
"_color": { "_color": {
@ -55050,7 +55264,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1160 "__id__": 1165
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -55082,7 +55296,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1160 "__id__": 1165
}, },
"_enabled": true, "_enabled": true,
"_id": "fdcyqVHbdJ6qjXrnxAvDP2" "_id": "fdcyqVHbdJ6qjXrnxAvDP2"
@ -55090,7 +55304,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 1159 "__id__": 1164
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55103,17 +55317,17 @@
"_name": "load", "_name": "load",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1159 "__id__": 1164
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1165 "__id__": 1170
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1166 "__id__": 1171
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -55167,7 +55381,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1164 "__id__": 1169
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -55197,7 +55411,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 1159 "__id__": 1164
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55210,17 +55424,17 @@
"_name": "New Label", "_name": "New Label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1159 "__id__": 1164
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1168 "__id__": 1173
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1169 "__id__": 1174
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -55274,7 +55488,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1167 "__id__": 1172
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -55305,7 +55519,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 1159 "__id__": 1164
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55318,7 +55532,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1159 "__id__": 1164
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
@ -55343,7 +55557,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 1159 "__id__": 1164
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55360,16 +55574,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 1173 "__id__": 1178
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 1176 "__id__": 1181
}, },
{ {
"__id__": 1177 "__id__": 1182
} }
], ],
"_prefab": null, "_prefab": null,
@ -55425,16 +55639,16 @@
"_name": "New Sprite(Splash)", "_name": "New Sprite(Splash)",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1172 "__id__": 1177
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1174 "__id__": 1179
}, },
{ {
"__id__": 1175 "__id__": 1180
} }
], ],
"_prefab": null, "_prefab": null,
@ -55490,7 +55704,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1173 "__id__": 1178
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -55522,7 +55736,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1173 "__id__": 1178
}, },
"_enabled": true, "_enabled": true,
"_id": "4fwjz1lnFLD45L1lqUY038" "_id": "4fwjz1lnFLD45L1lqUY038"
@ -55532,7 +55746,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1172 "__id__": 1177
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -55574,7 +55788,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1172 "__id__": 1177
}, },
"_enabled": false, "_enabled": false,
"_id": "00qpMLeBFNhYRX9r3QZvyP" "_id": "00qpMLeBFNhYRX9r3QZvyP"
@ -55688,7 +55902,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1183 "__id__": 1188
} }
], ],
"_prefab": null, "_prefab": null,
@ -55744,7 +55958,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1182 "__id__": 1187
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [

View File

@ -230,40 +230,17 @@ export default class Block extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this); this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
this.node['_touchListener'].setSwallowTouches(false); this.node['_touchListener'].setSwallowTouches(false);
setTimeout(() => { setTimeout(() => {
if (this.type == BlockType.) { if (this.type == BlockType. && this.block_Info.node) {
// 计算位置偏移 this.createNianHe(createAd);
const posOffset = cc.v2( }
this.node.x - this.block_Info.node.x, else {
this.node.y - this.block_Info.node.y if (this.type == BlockType.) {
); setTimeout(() => {
const targetNames = ['top', 'down', 'left', 'right']; this.createNianHe(createAd);
this.block_Info.node.children.forEach(child => { }, 200);
if (child instanceof cc.Node && targetNames.includes(child.name) && child.getComponent("lq_collide").data_string != "-1") {
const clonedChild = cc.instantiate(child);
clonedChild.getComponent("lq_collide").data_string = "-1";
clonedChild.parent = this.node;
// 获取子节点相对于父节点的位置
const relativePos = child.getPosition();
// 调整子节点位置以保证相对位置不变
clonedChild.setPosition(
relativePos.x - posOffset.x,
relativePos.y - posOffset.y
);
}
});
if (createAd) {
this.block_Info.node.getComponent("Block").adhesive = cc.v2(-posOffset.x, -posOffset.y);
if (this.node.zIndex >= this.block_Info.node.zIndex)
this.createAdhesive();
else
this.block_Info.node.getComponent("Block").createAdhesive();
} }
this.adhesive = posOffset;
} }
else if (this.type == BlockType.) { }, 200);
}
}, 100);
@ -306,6 +283,36 @@ export default class Block extends cc.Component {
} }
} }
createNianHe(createAd) {
const posOffset = cc.v2(
this.node.x - this.block_Info.node.x,
this.node.y - this.block_Info.node.y
);
const targetNames = ['top', 'down', 'left', 'right'];
this.block_Info.node.children.forEach(child => {
if (child instanceof cc.Node && targetNames.includes(child.name) && child.getComponent("lq_collide").data_string != "-1") {
const clonedChild = cc.instantiate(child);
clonedChild.getComponent("lq_collide").data_string = "-1";
clonedChild.parent = this.node;
// 获取子节点相对于父节点的位置
const relativePos = child.getPosition();
// 调整子节点位置以保证相对位置不变
clonedChild.setPosition(
relativePos.x - posOffset.x,
relativePos.y - posOffset.y
);
}
});
if (createAd) {
this.block_Info.node.getComponent("Block").adhesive = cc.v2(-posOffset.x, -posOffset.y);
if (this.node.zIndex >= this.block_Info.node.zIndex)
this.createAdhesive();
else
this.block_Info.node.getComponent("Block").createAdhesive();
}
this.adhesive = posOffset;
}
//初始化方块类型 //初始化方块类型

View File

@ -588,7 +588,8 @@ export default class JiaZai extends cc.Component {
if (!this.AvatarNode) { if (!this.AvatarNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.AvatarNode = cc.instantiate(JiaZai.cachedAvatarPrefab); this.AvatarNode = cc.instantiate(JiaZai.cachedAvatarPrefab);
this.node.addChild(this.AvatarNode); if (this.node && this.AvatarNode)
this.node.addChild(this.AvatarNode);
this.AvatarNode.getComponent("Avatar").init(); this.AvatarNode.getComponent("Avatar").init();
} else { } else {
// 非第一次使用,直接激活节点 // 非第一次使用,直接激活节点
@ -602,7 +603,8 @@ export default class JiaZai extends cc.Component {
if (!this.AvatarNode) { if (!this.AvatarNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.AvatarNode = cc.instantiate(JiaZai.cachedAvatarPrefab); this.AvatarNode = cc.instantiate(JiaZai.cachedAvatarPrefab);
this.node.addChild(this.AvatarNode); if (this.node && this.AvatarNode)
this.node.addChild(this.AvatarNode);
this.AvatarNode.getComponent("Avatar").init(); this.AvatarNode.getComponent("Avatar").init();
} else { } else {
// 非第一次使用,直接激活节点 // 非第一次使用,直接激活节点
@ -661,7 +663,8 @@ export default class JiaZai extends cc.Component {
cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo);
let health = cc.instantiate(this.health); let health = cc.instantiate(this.health);
this.node.addChild(health); if (this.node && health)
this.node.addChild(health);
let heathPop = health.getComponent("heathnum").heatht; let heathPop = health.getComponent("heathnum").heatht;
this.heath = heathPop; // 保存heath预制体引用 this.heath = heathPop; // 保存heath预制体引用
let swichs = health.getComponent("heathnum").switchNode; let swichs = health.getComponent("heathnum").switchNode;
@ -1031,7 +1034,8 @@ export default class JiaZai extends cc.Component {
if (!this.shopNode) { if (!this.shopNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.shopNode = cc.instantiate(JiaZai.cachedShopPrefab); this.shopNode = cc.instantiate(JiaZai.cachedShopPrefab);
this.node.addChild(this.shopNode); if (this.node && this.shopNode)
this.node.addChild(this.shopNode);
this.shopNode.getComponent("shop").init((res.data.shopDouble)); this.shopNode.getComponent("shop").init((res.data.shopDouble));
} else { } else {
// 非第一次使用,直接激活节点 // 非第一次使用,直接激活节点
@ -1058,14 +1062,16 @@ export default class JiaZai extends cc.Component {
if (!this.RewardNode) { if (!this.RewardNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.RewardNode = cc.instantiate(JiaZai.cachedRewardPrefab); this.RewardNode = cc.instantiate(JiaZai.cachedRewardPrefab);
this.node.addChild(this.RewardNode); if (this.node && this.RewardNode)
this.node.addChild(this.RewardNode);
this.RewardNode.getComponent("Reward").init(data); this.RewardNode.getComponent("Reward").init(data);
} }
else { else {
this.RewardNode.destroy(); this.RewardNode.destroy();
this.RewardNode = null; this.RewardNode = null;
this.RewardNode = cc.instantiate(JiaZai.cachedRewardPrefab); this.RewardNode = cc.instantiate(JiaZai.cachedRewardPrefab);
this.node.addChild(this.RewardNode); if (this.node && this.RewardNode)
this.node.addChild(this.RewardNode);
this.RewardNode.getComponent("Reward").init(data); this.RewardNode.getComponent("Reward").init(data);
} }
this.RewardNode.zIndex = 1001; this.RewardNode.zIndex = 1001;
@ -1099,7 +1105,8 @@ export default class JiaZai extends cc.Component {
if (!this.monthlyCardNode) { if (!this.monthlyCardNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.monthlyCardNode = cc.instantiate(JiaZai.cachedMonthlyCardPrefab); this.monthlyCardNode = cc.instantiate(JiaZai.cachedMonthlyCardPrefab);
this.node.addChild(this.monthlyCardNode); if (this.node && this.monthlyCardNode)
this.node.addChild(this.monthlyCardNode);
this.monthlyCardNode.active = true; this.monthlyCardNode.active = true;
this.monthlyCardNode.getComponent("monthlyCard").init(); this.monthlyCardNode.getComponent("monthlyCard").init();
this.monthlyCardNode.getComponent("monthlyCard").juwai = true; this.monthlyCardNode.getComponent("monthlyCard").juwai = true;
@ -1181,7 +1188,8 @@ export default class JiaZai extends cc.Component {
if (!this.dailyQuestsNode) { if (!this.dailyQuestsNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.dailyQuestsNode = cc.instantiate(JiaZai.cachedDailyQuestsPrefab); this.dailyQuestsNode = cc.instantiate(JiaZai.cachedDailyQuestsPrefab);
this.node.addChild(this.dailyQuestsNode); if (this.node && this.dailyQuestsNode)
this.node.addChild(this.dailyQuestsNode);
this.dailyQuestsNode.active = true; this.dailyQuestsNode.active = true;
this.dailyQuestsNode.getComponent("DailyQuests").init(data.data.task); this.dailyQuestsNode.getComponent("DailyQuests").init(data.data.task);
} else { } else {
@ -1504,7 +1512,8 @@ export default class JiaZai extends cc.Component {
if (!this.actionpNode) { if (!this.actionpNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab); this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab);
this.node.addChild(this.actionpNode); if (this.node && this.actionpNode)
this.node.addChild(this.actionpNode);
this.actionpNode.zIndex = 2; this.actionpNode.zIndex = 2;
this.actionpNode.getComponent("NewbieGift").init(true); this.actionpNode.getComponent("NewbieGift").init(true);
this.actionpNode.getChildByName("time").active = false; this.actionpNode.getChildByName("time").active = false;
@ -1522,7 +1531,8 @@ export default class JiaZai extends cc.Component {
if (!this.actionpNode) { if (!this.actionpNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab); this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab);
this.node.addChild(this.actionpNode); if (this.node && this.actionpNode)
this.node.addChild(this.actionpNode);
this.actionpNode.zIndex = 2; this.actionpNode.zIndex = 2;
this.actionpNode.getComponent("NewbieGift").init(true); this.actionpNode.getComponent("NewbieGift").init(true);
} else { } else {
@ -2024,7 +2034,8 @@ export default class JiaZai extends cc.Component {
if (!this.winStreakNode) { if (!this.winStreakNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.winStreakNode = cc.instantiate(JiaZai.cachedWinStreakPrefab); this.winStreakNode = cc.instantiate(JiaZai.cachedWinStreakPrefab);
this.node.addChild(this.winStreakNode); if (this.node && this.winStreakNode)
this.node.addChild(this.winStreakNode);
this.winStreakNode.getComponent("WinStreak").init(); this.winStreakNode.getComponent("WinStreak").init();
} else { } else {
// 非第一次使用,直接激活节点 // 非第一次使用,直接激活节点
@ -2038,7 +2049,8 @@ export default class JiaZai extends cc.Component {
if (!this.winStreakNode) { if (!this.winStreakNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.winStreakNode = cc.instantiate(JiaZai.cachedWinStreakPrefab); this.winStreakNode = cc.instantiate(JiaZai.cachedWinStreakPrefab);
this.node.addChild(this.winStreakNode); if (this.node && this.winStreakNode)
this.node.addChild(this.winStreakNode);
this.winStreakNode.active = true; this.winStreakNode.active = true;
this.winStreakNode.getComponent("WinStreak").init(); this.winStreakNode.getComponent("WinStreak").init();
} else { } else {
@ -2179,7 +2191,8 @@ export default class JiaZai extends cc.Component {
if (!this.passCheckNode || !cc.isValid(this.passCheckNode)) { if (!this.passCheckNode || !cc.isValid(this.passCheckNode)) {
// 节点不存在或已被销毁,需要重新创建 // 节点不存在或已被销毁,需要重新创建
this.passCheckNode = cc.instantiate(JiaZai.cachedPassCheckPrefab); this.passCheckNode = cc.instantiate(JiaZai.cachedPassCheckPrefab);
this.node.addChild(this.passCheckNode); if (this.node && this.passCheckNode)
this.node.addChild(this.passCheckNode);
this.passCheckNode.getComponent("passCheck").setInfo(passCheck); this.passCheckNode.getComponent("passCheck").setInfo(passCheck);
const hmScale = cc.fx.GameTool.adaptation(); const hmScale = cc.fx.GameTool.adaptation();
if (hmScale == 1) return; if (hmScale == 1) return;
@ -2898,7 +2911,8 @@ export default class JiaZai extends cc.Component {
} }
openRedeemCode() { openRedeemCode() {
let reddemCodeNode = cc.instantiate(this.reddemCodeNode); let reddemCodeNode = cc.instantiate(this.reddemCodeNode);
this.node.addChild(reddemCodeNode); if (this.node && reddemCodeNode)
this.node.addChild(reddemCodeNode);
} }
update(dt) { update(dt) {

View File

@ -44,7 +44,7 @@ export default class RippleShrink extends cc.Component {
} }
update(dt: number) { update(dt: number) {
if (!this.shouldShow && !this.running) { if (!this.shouldShow && !this.running && this.node) {
// 如果不需要显示且当前没有运行中的动画,则隐藏节点 // 如果不需要显示且当前没有运行中的动画,则隐藏节点
if (this.node.active) { if (this.node.active) {
this.node.active = false; this.node.active = false;

View File

@ -474,7 +474,8 @@ export default class SceneManager extends cc.Component {
if (!this.shopNode) { if (!this.shopNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.shopNode = cc.instantiate(SceneManager.cachedShopPrefab); this.shopNode = cc.instantiate(SceneManager.cachedShopPrefab);
this.node.addChild(this.shopNode); if (this.node && this.shopNode)
this.node.addChild(this.shopNode);
this.shopNode.getComponent("shop").init(res.data.shopDouble); this.shopNode.getComponent("shop").init(res.data.shopDouble);
} else { } else {
// 非第一次使用,直接激活节点 // 非第一次使用,直接激活节点
@ -513,7 +514,8 @@ export default class SceneManager extends cc.Component {
if (!this.monthlyCardNode) { if (!this.monthlyCardNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.monthlyCardNode = cc.instantiate(SceneManager.cachedMonthlyCardPrefab); this.monthlyCardNode = cc.instantiate(SceneManager.cachedMonthlyCardPrefab);
this.node.addChild(this.monthlyCardNode); if (this.node && this.monthlyCardNode)
this.node.addChild(this.monthlyCardNode);
this.monthlyCardNode.getComponent("monthlyCard").init(); this.monthlyCardNode.getComponent("monthlyCard").init();
this.monthlyCardNode.getComponent("monthlyCard").juwai = false; this.monthlyCardNode.getComponent("monthlyCard").juwai = false;
} else { } else {
@ -562,7 +564,8 @@ export default class SceneManager extends cc.Component {
if (!this.RewardNode) { if (!this.RewardNode) {
// 第一次使用,创建节点 // 第一次使用,创建节点
this.RewardNode = cc.instantiate(SceneManager.cachedRewardPrefab); this.RewardNode = cc.instantiate(SceneManager.cachedRewardPrefab);
this.node.addChild(this.RewardNode); if (this.node && this.RewardNode)
this.node.addChild(this.RewardNode);
this.RewardNode.zIndex = 99; this.RewardNode.zIndex = 99;
this.RewardNode.getComponent("Reward").init(data, callBack); this.RewardNode.getComponent("Reward").init(data, callBack);
} }
@ -570,7 +573,8 @@ export default class SceneManager extends cc.Component {
this.RewardNode.destroy(); this.RewardNode.destroy();
this.RewardNode = null; this.RewardNode = null;
this.RewardNode = cc.instantiate(SceneManager.cachedRewardPrefab); this.RewardNode = cc.instantiate(SceneManager.cachedRewardPrefab);
this.node.addChild(this.RewardNode); if (this.node && this.RewardNode)
this.node.addChild(this.RewardNode);
this.RewardNode.zIndex = 99; this.RewardNode.zIndex = 99;
this.RewardNode.getComponent("Reward").init(data, callBack); this.RewardNode.getComponent("Reward").init(data, callBack);
} }

View File

@ -195,7 +195,7 @@ export class LQCollide extends Component {
private checkDebugDrawValid() { private checkDebugDrawValid() {
if (!this._debugDrawer || !this._debugDrawer.isValid) { if (!this._debugDrawer || !this._debugDrawer.isValid) {
let node = this.node.getChildByName('Collide'); let node = this.node.getChildByName('Collide');
if (!node) { if (!node && this.node) {
node = new Node('Collide'); node = new Node('Collide');
node.zIndex = macro.MAX_ZINDEX; node.zIndex = macro.MAX_ZINDEX;
this.node.addChild(node); this.node.addChild(node);

View File

@ -39,29 +39,29 @@
"__id__": 236 "__id__": 236
}, },
{ {
"__id__": 241 "__id__": 238
},
{
"__id__": 243
}, },
{ {
"__id__": 246 "__id__": 246
}, },
{ {
"__id__": 249 "__id__": 259
},
{
"__id__": 262
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 286 "__id__": 283
}, },
{ {
"__id__": 287 "__id__": 284
} }
], ],
"_prefab": { "_prefab": {
"__id__": 288 "__id__": 285
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -3665,7 +3665,7 @@
1, 1,
1, 1,
1, 1,
1 0
] ]
}, },
"_eulerAngles": { "_eulerAngles": {
@ -8881,16 +8881,9 @@
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [],
{
"__id__": 237
},
{
"__id__": 238
}
],
"_prefab": { "_prefab": {
"__id__": 240 "__id__": 237
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -8939,124 +8932,6 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "" "_id": ""
}, },
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 236
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e58fcacb-1189-4c5c-a0c0-4d2ef8fe52ad"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "2e466cd1-95aa-4e3c-bb69-759c50404dd1"
},
"_id": ""
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 236
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 239
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 236
},
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "85d4dxmxudMdYZYkFIP8dCp",
"handler": "getAllReward",
"customEventData": ""
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -9079,14 +8954,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 242 "__id__": 239
}, },
{ {
"__id__": 243 "__id__": 240
} }
], ],
"_prefab": { "_prefab": {
"__id__": 245 "__id__": 242
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -9140,7 +9015,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 241 "__id__": 238
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -9174,7 +9049,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 241 "__id__": 238
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
@ -9183,7 +9058,7 @@
"zoomScale": 1.1, "zoomScale": 1.1,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 244 "__id__": 241
} }
], ],
"_N$interactable": true, "_N$interactable": true,
@ -9239,7 +9114,7 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 241 "__id__": 238
}, },
"_id": "" "_id": ""
}, },
@ -9275,11 +9150,11 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 247 "__id__": 244
} }
], ],
"_prefab": { "_prefab": {
"__id__": 248 "__id__": 245
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -9333,7 +9208,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 246 "__id__": 243
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -9380,23 +9255,23 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 250 "__id__": 247
},
{
"__id__": 251
}, },
{ {
"__id__": 254 "__id__": 254
},
{
"__id__": 257
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 260 "__id__": 257
} }
], ],
"_prefab": { "_prefab": {
"__id__": 261 "__id__": 258
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -9450,20 +9325,20 @@
"_name": "New Sprite(Splash)", "_name": "New Sprite(Splash)",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 249 "__id__": 246
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 251 "__id__": 248
}, },
{ {
"__id__": 252 "__id__": 249
} }
], ],
"_prefab": { "_prefab": {
"__id__": 253 "__id__": 250
}, },
"_opacity": 120, "_opacity": 120,
"_color": { "_color": {
@ -9517,7 +9392,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 250 "__id__": 247
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -9549,7 +9424,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 250 "__id__": 247
}, },
"_enabled": true, "_enabled": true,
"_id": "" "_id": ""
@ -9557,7 +9432,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 249 "__id__": 246
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9570,17 +9445,17 @@
"_name": "load", "_name": "load",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 249 "__id__": 246
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 255 "__id__": 252
} }
], ],
"_prefab": { "_prefab": {
"__id__": 256 "__id__": 253
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -9634,7 +9509,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 254 "__id__": 251
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -9664,7 +9539,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 249 "__id__": 246
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9677,17 +9552,17 @@
"_name": "New Label", "_name": "New Label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 249 "__id__": 246
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 258 "__id__": 255
} }
], ],
"_prefab": { "_prefab": {
"__id__": 259 "__id__": 256
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -9741,7 +9616,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 257 "__id__": 254
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -9772,7 +9647,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 249 "__id__": 246
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9785,7 +9660,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 249 "__id__": 246
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
@ -9810,7 +9685,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 249 "__id__": 246
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9827,7 +9702,10 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 263 "__id__": 260
},
{
"__id__": 264
}, },
{ {
"__id__": 267 "__id__": 267
@ -9837,19 +9715,16 @@
}, },
{ {
"__id__": 273 "__id__": 273
},
{
"__id__": 276
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 284 "__id__": 281
} }
], ],
"_prefab": { "_prefab": {
"__id__": 285 "__id__": 282
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -9903,20 +9778,20 @@
"_name": "New Sprite(Splash)", "_name": "New Sprite(Splash)",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 262 "__id__": 259
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 264 "__id__": 261
}, },
{ {
"__id__": 265 "__id__": 262
} }
], ],
"_prefab": { "_prefab": {
"__id__": 266 "__id__": 263
}, },
"_opacity": 120, "_opacity": 120,
"_color": { "_color": {
@ -9970,7 +9845,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 263 "__id__": 260
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -10002,7 +9877,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 263 "__id__": 260
}, },
"_enabled": true, "_enabled": true,
"_id": "" "_id": ""
@ -10010,7 +9885,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10023,17 +9898,17 @@
"_name": "bg", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 262 "__id__": 259
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 268 "__id__": 265
} }
], ],
"_prefab": { "_prefab": {
"__id__": 269 "__id__": 266
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -10087,7 +9962,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 267 "__id__": 264
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -10117,7 +9992,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10130,17 +10005,17 @@
"_name": "title", "_name": "title",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 262 "__id__": 259
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 271 "__id__": 268
} }
], ],
"_prefab": { "_prefab": {
"__id__": 272 "__id__": 269
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -10194,7 +10069,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 270 "__id__": 267
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -10225,7 +10100,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10238,17 +10113,17 @@
"_name": "New Label", "_name": "New Label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 262 "__id__": 259
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 274 "__id__": 271
} }
], ],
"_prefab": { "_prefab": {
"__id__": 275 "__id__": 272
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -10302,7 +10177,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 273 "__id__": 270
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -10333,7 +10208,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10346,24 +10221,24 @@
"_name": "New Sprite", "_name": "New Sprite",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 262 "__id__": 259
}, },
"_children": [ "_children": [
{ {
"__id__": 277 "__id__": 274
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 280 "__id__": 277
}, },
{ {
"__id__": 281 "__id__": 278
} }
], ],
"_prefab": { "_prefab": {
"__id__": 283 "__id__": 280
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -10417,17 +10292,17 @@
"_name": "New Label", "_name": "New Label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 276 "__id__": 273
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 278 "__id__": 275
} }
], ],
"_prefab": { "_prefab": {
"__id__": 279 "__id__": 276
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -10481,7 +10356,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 277 "__id__": 274
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -10512,7 +10387,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10525,7 +10400,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 276 "__id__": 273
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -10557,7 +10432,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 276 "__id__": 273
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
@ -10566,7 +10441,7 @@
"zoomScale": 1.1, "zoomScale": 1.1,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 282 "__id__": 279
} }
], ],
"_N$interactable": true, "_N$interactable": true,
@ -10622,7 +10497,7 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 276 "__id__": 273
}, },
"_id": "" "_id": ""
}, },
@ -10639,7 +10514,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10652,7 +10527,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 262 "__id__": 259
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
@ -10677,7 +10552,7 @@
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 262 "__id__": 259
}, },
"asset": { "asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"

View File

@ -171,13 +171,14 @@ export default class DailyQuests extends cc.Component {
}, 1000); }, 1000);
} }
//购买月卡 //領取獎勵
openReward(name, res) { openReward(name, res) {
console.log("获取奖励名称", name);
let data = null; let data = null;
if (name == "levelPass") { if (name == "levelPass") {
data = [ data = [
{ type: "coin", count: 100 }, { type: "coin", count: 100 },
{ type: "freeze", count: 2 } { type: "freeze", count: 1 }
] ]
let data2 = { let data2 = {
id: 0, id: 0,
@ -236,6 +237,7 @@ export default class DailyQuests extends cc.Component {
"freeze": shuju.freeze || 0, "freeze": shuju.freeze || 0,
"hammer": shuju.hammer || 0, "hammer": shuju.hammer || 0,
"magic_wand": shuju.magic || 0, "magic_wand": shuju.magic || 0,
"infinite_health": shuju.infinite_health || 0,
"price": 0 "price": 0
} }
this.getShopProp(propData); this.getShopProp(propData);
@ -243,6 +245,7 @@ export default class DailyQuests extends cc.Component {
cc.fx.GameTool.changeCoin(shuju.coin); cc.fx.GameTool.changeCoin(shuju.coin);
} }
if (shuju.infinite_health > 0) { if (shuju.infinite_health > 0) {
console.log("_______获得无限体力时间:", shuju.infinite_health, name);
cc.fx.GameTool.setUserPowerTime(shuju.infinite_health); cc.fx.GameTool.setUserPowerTime(shuju.infinite_health);
} }
@ -357,9 +360,11 @@ export default class DailyQuests extends cc.Component {
this.touchStart = false; this.touchStart = false;
this.reward = true; this.reward = true;
let shuju = [data]; let shuju = [data];
this.openLoad();
Utils.getDailyQuestReward(shuju, (res) => { Utils.getDailyQuestReward(shuju, (res) => {
this.touchStart = true; this.touchStart = true;
this.reward = false; this.reward = false;
this.closeLoad();
if (res.code == 1) { if (res.code == 1) {
let dataNode = null; let dataNode = null;
for (let i = 0; i < this.content.children.length; i++) { for (let i = 0; i < this.content.children.length; i++) {
@ -385,103 +390,108 @@ export default class DailyQuests extends cc.Component {
} }
}) })
setTimeout(() => { setTimeout(() => {
if (this.reward == true && this.touchStart == false) { if (this.node) {
this.touchStart = true; this.node.getChildByName("Loading").active = true
if (this.reward == true && this.touchStart == false && this.node.getChildByName("Loading").active == true) {
this.touchStart = true;
this.closeLoad();
MiniGameSdk.API.showToast("网络异常,领取奖励失败");
}
} }
}, 5000); }, 5000);
} }
getAllReward() { getAllReward() {
if (this.touchStart == false) { // if (this.touchStart == false) {
return; // return;
} // }
this.touchStart = false; // this.touchStart = false;
this.reward = true; // this.reward = true;
let shuju = []; // let shuju = [];
for (let i = 0; i < this.content.children.length; i++) { // for (let i = 0; i < this.content.children.length; i++) {
let dataNode = this.content.children[i]; // let dataNode = this.content.children[i];
if (dataNode.getChildByName("get").active == true) { // if (dataNode.getChildByName("get").active == true) {
shuju.push(dataNode.name); // shuju.push(dataNode.name);
} // }
} // }
console.log("准备上传的任务", shuju); // console.log("准备上传的任务", shuju);
Utils.getDailyQuestReward(shuju, (res) => { // Utils.getDailyQuestReward(shuju, (res) => {
this.touchStart = true; // this.touchStart = true;
this.reward = false; // this.reward = false;
if (res.code == 1) { // if (res.code == 1) {
let data = [ // let data = [
{ type: "coin", count: 0 }, // { type: "coin", count: 0 },
{ type: "freeze", count: 0 }, // { type: "freeze", count: 0 },
{ type: "hammer", count: 0 }, // { type: "hammer", count: 0 },
{ type: "magic", count: 0 }, // { type: "magic", count: 0 },
{ type: "infinite_health", count: 0 }, // { type: "infinite_health", count: 0 },
] // ]
for (let i = 0; i < this.content.children.length; i++) { // for (let i = 0; i < this.content.children.length; i++) {
let dataNode = this.content.children[i]; // let dataNode = this.content.children[i];
if (dataNode.getChildByName("get").active == true) { // if (dataNode.getChildByName("get").active == true) {
dataNode.getChildByName("get").active = false; // dataNode.getChildByName("get").active = false;
if (dataNode.name == "levelPass") { // if (dataNode.name == "levelPass") {
data[0].count += 100; // data[0].count += 100;
data[1].count += 2; // data[1].count += 2;
let data2 = { // let data2 = {
id: 0, // id: 0,
status: "claim" // status: "claim"
} // }
cc.fx.GameTool.shushu_Track("daily_task", data2); // cc.fx.GameTool.shushu_Track("daily_task", data2);
} // }
else if (dataNode.name == "useProp") { // else if (dataNode.name == "useProp") {
data[2].count += 1; // data[2].count += 1;
let data2 = { // let data2 = {
id: 3, // id: 3,
status: "claim" // status: "claim"
} // }
cc.fx.GameTool.shushu_Track("daily_task", data2); // cc.fx.GameTool.shushu_Track("daily_task", data2);
} // }
else if (dataNode.name == "useEnergy") { // else if (dataNode.name == "useEnergy") {
data[0].count += 100; // data[0].count += 100;
data[3].count += 1; // data[3].count += 1;
let data2 = { // let data2 = {
id: 2, // id: 2,
status: "claim" // status: "claim"
} // }
cc.fx.GameTool.shushu_Track("daily_task", data2); // cc.fx.GameTool.shushu_Track("daily_task", data2);
} // }
else if (dataNode.name == "share") { // else if (dataNode.name == "share") {
data[4].count += 900; // data[4].count += 900;
let data2 = { // let data2 = {
id: 1, // id: 1,
status: "claim" // status: "claim"
} // }
cc.fx.GameTool.shushu_Track("daily_task", data2); // cc.fx.GameTool.shushu_Track("daily_task", data2);
} // }
cc.tween(dataNode) // cc.tween(dataNode)
.to(0.4, { x: dataNode.x - 1000, opacity: 50 }) // .to(0.4, { x: dataNode.x - 1000, opacity: 50 })
.call(() => { // .call(() => {
this.touchStart = true; // this.touchStart = true;
dataNode.removeFromParent(); // dataNode.removeFromParent();
this.content.getComponent(cc.Layout).updateLayout(); // this.content.getComponent(cc.Layout).updateLayout();
this.checkGetReward(); // this.checkGetReward();
}) // })
.start(); // .start();
} // }
} // }
for (let j = 0; j < data.length; j++) { // for (let j = 0; j < data.length; j++) {
if (data[j].count == 0) { // if (data[j].count == 0) {
data.splice(j, 1); // data.splice(j, 1);
j--; // j--;
} // }
} // }
this.openReward("all", data); // this.openReward("all", data);
} // }
else { // else {
MiniGameSdk.API.showToast("网络异常,领取奖励失败"); // MiniGameSdk.API.showToast("网络异常,领取奖励失败");
} // }
}) // })
setTimeout(() => { // setTimeout(() => {
if (this.reward == true && this.touchStart == false) { // if (this.reward == true && this.touchStart == false) {
this.touchStart = true; // this.touchStart = true;
} // }
}, 5000); // }, 5000);
} }
checkGetReward() { checkGetReward() {
@ -505,33 +515,55 @@ export default class DailyQuests extends cc.Component {
//@ts-ignore //@ts-ignore
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) { if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) {
const num = 0; const num = 0;
//console.log("_________道具增加的数量为:", num); const timestamp = Date.now();
console.log("_________道具增加的数量为:", propData);
cc.fx.GameConfig.GM_INFO.freezeAmount += propData.freeze; cc.fx.GameConfig.GM_INFO.freezeAmount += propData.freeze;
cc.fx.GameConfig.GM_INFO.hammerAmount += propData.hammer; cc.fx.GameConfig.GM_INFO.hammerAmount += propData.hammer;
cc.fx.GameConfig.GM_INFO.magicAmount += propData.magic_wand; cc.fx.GameConfig.GM_INFO.magicAmount += propData.magic_wand;
let propInfo = cc.fx.StorageMessage.getStorage("prop");
propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
propInfo.magicAmount = cc.fx.GameConfig.GM_INFO.magicAmount;
propInfo.freezeAmount = cc.fx.GameConfig.GM_INFO.freezeAmount;
propInfo.timestamp = timestamp;
cc.fx.StorageMessage.setStorage("prop", propInfo);
cc.fx.GameTool.setUserProp(0, num, (data) => { cc.fx.GameTool.setUserProp(0, num, (data) => {
}) })
const data1 = { if (propData.freeze > 0) {
change_reason: "quests", const data1 = {
id: 2001, change_reason: "quests",
num: propData.freeze, id: 2001,
compensate: false num: propData.freeze,
compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", data1);
} }
cc.fx.GameTool.shushu_Track("resource_get", data1); else if (propData.hammer > 0) {
const data2 = { const data2 = {
change_reason: "quests", change_reason: "quests",
id: 2002, id: 2002,
num: propData.hammer, num: propData.hammer,
compensate: false compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", data2);
} }
cc.fx.GameTool.shushu_Track("resource_get", data2); else if (propData.magic_wand > 0) {
const data3 = { const data3 = {
change_reason: "quests", change_reason: "quests",
id: 2003, id: 2003,
num: propData.magic_wand, num: propData.magic_wand,
compensate: false compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", data3);
}
else if (propData.infinite_health > 0) {
const data4 = {
change_reason: "quests",
id: 2004,
num: propData.infinite_health,
compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", data4);
} }
cc.fx.GameTool.shushu_Track("resource_get", data3);
} }
} }
@ -539,7 +571,4 @@ export default class DailyQuests extends cc.Component {
} }
update() {
}
} }

View File

@ -535,7 +535,5 @@ export default class NewbieGift extends cc.Component {
} }
update() {
}
} }

View File

@ -155,7 +155,5 @@ export default class WinStreak extends cc.Component {
} }
} }
update() {
}
} }

View File

@ -709,8 +709,8 @@ export default class passCheck extends cc.Component {
butActivate.getComponent("buyActivate").init(() => { butActivate.getComponent("buyActivate").init(() => {
this.onBuyActivate(); this.onBuyActivate();
}, timeStr); }, timeStr);
if (this.node && butActivate)
this.node.addChild(butActivate); this.node.addChild(butActivate);
} }
} }