Compare commits

..

No commits in common. "719a170c8520946d20e28f1892ad257a1f017f2d" and "efb888519079a49a71522fdb407eac7e1873082f" have entirely different histories.

11 changed files with 434 additions and 573 deletions

View File

@ -17,7 +17,7 @@
"__id__": 2
},
{
"__id__": 1187
"__id__": 1182
}
],
"_active": false,
@ -84,25 +84,25 @@
"__id__": 1037
},
{
"__id__": 1164
"__id__": 1159
},
{
"__id__": 1177
"__id__": 1172
}
],
"_active": true,
"_components": [
{
"__id__": 1183
"__id__": 1178
},
{
"__id__": 1184
"__id__": 1179
},
{
"__id__": 1185
"__id__": 1180
},
{
"__id__": 1186
"__id__": 1181
}
],
"_prefab": null,
@ -49113,15 +49113,12 @@
},
{
"__id__": 1123
},
{
"__id__": 1158
}
],
"_active": false,
"_components": [
{
"__id__": 1163
"__id__": 1158
}
],
"_prefab": null,
@ -54882,217 +54879,6 @@
"_originalHeight": 1920,
"_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",
"_name": "",
@ -55127,23 +54913,23 @@
},
"_children": [
{
"__id__": 1165
"__id__": 1160
},
{
"__id__": 1169
"__id__": 1164
},
{
"__id__": 1172
"__id__": 1167
}
],
"_active": false,
"_components": [
{
"__id__": 1175
"__id__": 1170
}
],
"_prefab": {
"__id__": 1176
"__id__": 1171
},
"_opacity": 255,
"_color": {
@ -55197,20 +54983,20 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 1164
"__id__": 1159
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1166
"__id__": 1161
},
{
"__id__": 1167
"__id__": 1162
}
],
"_prefab": {
"__id__": 1168
"__id__": 1163
},
"_opacity": 120,
"_color": {
@ -55264,7 +55050,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1165
"__id__": 1160
},
"_enabled": true,
"_materials": [
@ -55296,7 +55082,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1165
"__id__": 1160
},
"_enabled": true,
"_id": "fdcyqVHbdJ6qjXrnxAvDP2"
@ -55304,7 +55090,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1164
"__id__": 1159
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55317,17 +55103,17 @@
"_name": "load",
"_objFlags": 0,
"_parent": {
"__id__": 1164
"__id__": 1159
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1170
"__id__": 1165
}
],
"_prefab": {
"__id__": 1171
"__id__": 1166
},
"_opacity": 255,
"_color": {
@ -55381,7 +55167,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1169
"__id__": 1164
},
"_enabled": true,
"_materials": [
@ -55411,7 +55197,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1164
"__id__": 1159
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55424,17 +55210,17 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 1164
"__id__": 1159
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1173
"__id__": 1168
}
],
"_prefab": {
"__id__": 1174
"__id__": 1169
},
"_opacity": 255,
"_color": {
@ -55488,7 +55274,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1172
"__id__": 1167
},
"_enabled": true,
"_materials": [
@ -55519,7 +55305,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1164
"__id__": 1159
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55532,7 +55318,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1164
"__id__": 1159
},
"_enabled": true,
"alignMode": 1,
@ -55557,7 +55343,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1164
"__id__": 1159
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -55574,16 +55360,16 @@
},
"_children": [
{
"__id__": 1178
"__id__": 1173
}
],
"_active": false,
"_components": [
{
"__id__": 1181
"__id__": 1176
},
{
"__id__": 1182
"__id__": 1177
}
],
"_prefab": null,
@ -55639,16 +55425,16 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 1177
"__id__": 1172
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1179
"__id__": 1174
},
{
"__id__": 1180
"__id__": 1175
}
],
"_prefab": null,
@ -55704,7 +55490,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1178
"__id__": 1173
},
"_enabled": true,
"_materials": [
@ -55736,7 +55522,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1178
"__id__": 1173
},
"_enabled": true,
"_id": "4fwjz1lnFLD45L1lqUY038"
@ -55746,7 +55532,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1177
"__id__": 1172
},
"_enabled": true,
"_materials": [
@ -55788,7 +55574,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1177
"__id__": 1172
},
"_enabled": false,
"_id": "00qpMLeBFNhYRX9r3QZvyP"
@ -55902,7 +55688,7 @@
"_active": true,
"_components": [
{
"__id__": 1188
"__id__": 1183
}
],
"_prefab": null,
@ -55958,7 +55744,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1187
"__id__": 1182
},
"_enabled": true,
"_materials": [

View File

@ -230,17 +230,40 @@ export default class Block extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
this.node['_touchListener'].setSwallowTouches(false);
setTimeout(() => {
if (this.type == BlockType. && this.block_Info.node) {
this.createNianHe(createAd);
}
else {
if (this.type == BlockType.) {
setTimeout(() => {
this.createNianHe(createAd);
}, 200);
// 计算位置偏移
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();
}
}, 200);
this.adhesive = posOffset;
}
else if (this.type == BlockType.) {
}
}, 100);
@ -283,36 +306,6 @@ 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,6 @@ export default class JiaZai extends cc.Component {
if (!this.AvatarNode) {
// 第一次使用,创建节点
this.AvatarNode = cc.instantiate(JiaZai.cachedAvatarPrefab);
if (this.node && this.AvatarNode)
this.node.addChild(this.AvatarNode);
this.AvatarNode.getComponent("Avatar").init();
} else {
@ -603,7 +602,6 @@ export default class JiaZai extends cc.Component {
if (!this.AvatarNode) {
// 第一次使用,创建节点
this.AvatarNode = cc.instantiate(JiaZai.cachedAvatarPrefab);
if (this.node && this.AvatarNode)
this.node.addChild(this.AvatarNode);
this.AvatarNode.getComponent("Avatar").init();
} else {
@ -663,7 +661,6 @@ export default class JiaZai extends cc.Component {
cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo);
let health = cc.instantiate(this.health);
if (this.node && health)
this.node.addChild(health);
let heathPop = health.getComponent("heathnum").heatht;
this.heath = heathPop; // 保存heath预制体引用
@ -1034,7 +1031,6 @@ export default class JiaZai extends cc.Component {
if (!this.shopNode) {
// 第一次使用,创建节点
this.shopNode = cc.instantiate(JiaZai.cachedShopPrefab);
if (this.node && this.shopNode)
this.node.addChild(this.shopNode);
this.shopNode.getComponent("shop").init((res.data.shopDouble));
} else {
@ -1062,7 +1058,6 @@ export default class JiaZai extends cc.Component {
if (!this.RewardNode) {
// 第一次使用,创建节点
this.RewardNode = cc.instantiate(JiaZai.cachedRewardPrefab);
if (this.node && this.RewardNode)
this.node.addChild(this.RewardNode);
this.RewardNode.getComponent("Reward").init(data);
}
@ -1070,7 +1065,6 @@ export default class JiaZai extends cc.Component {
this.RewardNode.destroy();
this.RewardNode = null;
this.RewardNode = cc.instantiate(JiaZai.cachedRewardPrefab);
if (this.node && this.RewardNode)
this.node.addChild(this.RewardNode);
this.RewardNode.getComponent("Reward").init(data);
}
@ -1105,7 +1099,6 @@ export default class JiaZai extends cc.Component {
if (!this.monthlyCardNode) {
// 第一次使用,创建节点
this.monthlyCardNode = cc.instantiate(JiaZai.cachedMonthlyCardPrefab);
if (this.node && this.monthlyCardNode)
this.node.addChild(this.monthlyCardNode);
this.monthlyCardNode.active = true;
this.monthlyCardNode.getComponent("monthlyCard").init();
@ -1188,7 +1181,6 @@ export default class JiaZai extends cc.Component {
if (!this.dailyQuestsNode) {
// 第一次使用,创建节点
this.dailyQuestsNode = cc.instantiate(JiaZai.cachedDailyQuestsPrefab);
if (this.node && this.dailyQuestsNode)
this.node.addChild(this.dailyQuestsNode);
this.dailyQuestsNode.active = true;
this.dailyQuestsNode.getComponent("DailyQuests").init(data.data.task);
@ -1512,7 +1504,6 @@ export default class JiaZai extends cc.Component {
if (!this.actionpNode) {
// 第一次使用,创建节点
this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab);
if (this.node && this.actionpNode)
this.node.addChild(this.actionpNode);
this.actionpNode.zIndex = 2;
this.actionpNode.getComponent("NewbieGift").init(true);
@ -1531,7 +1522,6 @@ export default class JiaZai extends cc.Component {
if (!this.actionpNode) {
// 第一次使用,创建节点
this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab);
if (this.node && this.actionpNode)
this.node.addChild(this.actionpNode);
this.actionpNode.zIndex = 2;
this.actionpNode.getComponent("NewbieGift").init(true);
@ -2034,7 +2024,6 @@ export default class JiaZai extends cc.Component {
if (!this.winStreakNode) {
// 第一次使用,创建节点
this.winStreakNode = cc.instantiate(JiaZai.cachedWinStreakPrefab);
if (this.node && this.winStreakNode)
this.node.addChild(this.winStreakNode);
this.winStreakNode.getComponent("WinStreak").init();
} else {
@ -2049,7 +2038,6 @@ export default class JiaZai extends cc.Component {
if (!this.winStreakNode) {
// 第一次使用,创建节点
this.winStreakNode = cc.instantiate(JiaZai.cachedWinStreakPrefab);
if (this.node && this.winStreakNode)
this.node.addChild(this.winStreakNode);
this.winStreakNode.active = true;
this.winStreakNode.getComponent("WinStreak").init();
@ -2191,7 +2179,6 @@ export default class JiaZai extends cc.Component {
if (!this.passCheckNode || !cc.isValid(this.passCheckNode)) {
// 节点不存在或已被销毁,需要重新创建
this.passCheckNode = cc.instantiate(JiaZai.cachedPassCheckPrefab);
if (this.node && this.passCheckNode)
this.node.addChild(this.passCheckNode);
this.passCheckNode.getComponent("passCheck").setInfo(passCheck);
const hmScale = cc.fx.GameTool.adaptation();
@ -2911,7 +2898,6 @@ export default class JiaZai extends cc.Component {
}
openRedeemCode() {
let reddemCodeNode = cc.instantiate(this.reddemCodeNode);
if (this.node && reddemCodeNode)
this.node.addChild(reddemCodeNode);
}

View File

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

View File

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

View File

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

View File

@ -39,29 +39,29 @@
"__id__": 236
},
{
"__id__": 238
},
{
"__id__": 243
"__id__": 241
},
{
"__id__": 246
},
{
"__id__": 259
"__id__": 249
},
{
"__id__": 262
}
],
"_active": true,
"_components": [
{
"__id__": 283
"__id__": 286
},
{
"__id__": 284
"__id__": 287
}
],
"_prefab": {
"__id__": 285
"__id__": 288
},
"_opacity": 255,
"_color": {
@ -3665,7 +3665,7 @@
1,
1,
1,
0
1
]
},
"_eulerAngles": {
@ -8881,10 +8881,17 @@
},
"_children": [],
"_active": false,
"_components": [],
"_prefab": {
"_components": [
{
"__id__": 237
},
{
"__id__": 238
}
],
"_prefab": {
"__id__": 240
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
@ -8932,6 +8939,124 @@
"groupIndex": 0,
"_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",
"root": {
@ -8954,14 +9079,14 @@
"_active": true,
"_components": [
{
"__id__": 239
"__id__": 242
},
{
"__id__": 240
"__id__": 243
}
],
"_prefab": {
"__id__": 242
"__id__": 245
},
"_opacity": 255,
"_color": {
@ -9015,7 +9140,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 238
"__id__": 241
},
"_enabled": true,
"_materials": [
@ -9049,7 +9174,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 238
"__id__": 241
},
"_enabled": true,
"_normalMaterial": null,
@ -9058,7 +9183,7 @@
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 241
"__id__": 244
}
],
"_N$interactable": true,
@ -9114,7 +9239,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 238
"__id__": 241
},
"_id": ""
},
@ -9150,11 +9275,11 @@
"_active": false,
"_components": [
{
"__id__": 244
"__id__": 247
}
],
"_prefab": {
"__id__": 245
"__id__": 248
},
"_opacity": 255,
"_color": {
@ -9208,7 +9333,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 243
"__id__": 246
},
"_enabled": true,
"_materials": [
@ -9255,23 +9380,23 @@
},
"_children": [
{
"__id__": 247
},
{
"__id__": 251
"__id__": 250
},
{
"__id__": 254
},
{
"__id__": 257
}
],
"_active": false,
"_components": [
{
"__id__": 257
"__id__": 260
}
],
"_prefab": {
"__id__": 258
"__id__": 261
},
"_opacity": 255,
"_color": {
@ -9325,20 +9450,20 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 246
"__id__": 249
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 248
"__id__": 251
},
{
"__id__": 249
"__id__": 252
}
],
"_prefab": {
"__id__": 250
"__id__": 253
},
"_opacity": 120,
"_color": {
@ -9392,7 +9517,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 247
"__id__": 250
},
"_enabled": true,
"_materials": [
@ -9424,7 +9549,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 247
"__id__": 250
},
"_enabled": true,
"_id": ""
@ -9432,7 +9557,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 246
"__id__": 249
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9445,17 +9570,17 @@
"_name": "load",
"_objFlags": 0,
"_parent": {
"__id__": 246
"__id__": 249
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 252
"__id__": 255
}
],
"_prefab": {
"__id__": 253
"__id__": 256
},
"_opacity": 255,
"_color": {
@ -9509,7 +9634,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 251
"__id__": 254
},
"_enabled": true,
"_materials": [
@ -9539,7 +9664,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 246
"__id__": 249
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9552,17 +9677,17 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 246
"__id__": 249
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 255
"__id__": 258
}
],
"_prefab": {
"__id__": 256
"__id__": 259
},
"_opacity": 255,
"_color": {
@ -9616,7 +9741,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 254
"__id__": 257
},
"_enabled": true,
"_materials": [
@ -9647,7 +9772,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 246
"__id__": 249
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9660,7 +9785,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 246
"__id__": 249
},
"_enabled": true,
"alignMode": 1,
@ -9685,7 +9810,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 246
"__id__": 249
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9702,10 +9827,7 @@
},
"_children": [
{
"__id__": 260
},
{
"__id__": 264
"__id__": 263
},
{
"__id__": 267
@ -9715,16 +9837,19 @@
},
{
"__id__": 273
},
{
"__id__": 276
}
],
"_active": false,
"_components": [
{
"__id__": 281
"__id__": 284
}
],
"_prefab": {
"__id__": 282
"__id__": 285
},
"_opacity": 255,
"_color": {
@ -9778,20 +9903,20 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 259
"__id__": 262
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 261
"__id__": 264
},
{
"__id__": 262
"__id__": 265
}
],
"_prefab": {
"__id__": 263
"__id__": 266
},
"_opacity": 120,
"_color": {
@ -9845,7 +9970,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 260
"__id__": 263
},
"_enabled": true,
"_materials": [
@ -9877,7 +10002,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 260
"__id__": 263
},
"_enabled": true,
"_id": ""
@ -9885,7 +10010,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -9898,17 +10023,17 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 259
"__id__": 262
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 265
"__id__": 268
}
],
"_prefab": {
"__id__": 266
"__id__": 269
},
"_opacity": 255,
"_color": {
@ -9962,7 +10087,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 264
"__id__": 267
},
"_enabled": true,
"_materials": [
@ -9992,7 +10117,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10005,17 +10130,17 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 259
"__id__": 262
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 268
"__id__": 271
}
],
"_prefab": {
"__id__": 269
"__id__": 272
},
"_opacity": 255,
"_color": {
@ -10069,7 +10194,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 267
"__id__": 270
},
"_enabled": true,
"_materials": [
@ -10100,7 +10225,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10113,17 +10238,17 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 259
"__id__": 262
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 271
"__id__": 274
}
],
"_prefab": {
"__id__": 272
"__id__": 275
},
"_opacity": 255,
"_color": {
@ -10177,7 +10302,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 270
"__id__": 273
},
"_enabled": true,
"_materials": [
@ -10208,7 +10333,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10221,24 +10346,24 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 259
"__id__": 262
},
"_children": [
{
"__id__": 274
"__id__": 277
}
],
"_active": true,
"_components": [
{
"__id__": 277
"__id__": 280
},
{
"__id__": 278
"__id__": 281
}
],
"_prefab": {
"__id__": 280
"__id__": 283
},
"_opacity": 255,
"_color": {
@ -10292,17 +10417,17 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 273
"__id__": 276
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 275
"__id__": 278
}
],
"_prefab": {
"__id__": 276
"__id__": 279
},
"_opacity": 255,
"_color": {
@ -10356,7 +10481,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 274
"__id__": 277
},
"_enabled": true,
"_materials": [
@ -10387,7 +10512,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10400,7 +10525,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 273
"__id__": 276
},
"_enabled": true,
"_materials": [
@ -10432,7 +10557,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 273
"__id__": 276
},
"_enabled": true,
"_normalMaterial": null,
@ -10441,7 +10566,7 @@
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 279
"__id__": 282
}
],
"_N$interactable": true,
@ -10497,7 +10622,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 273
"__id__": 276
},
"_id": ""
},
@ -10514,7 +10639,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
@ -10527,7 +10652,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 259
"__id__": 262
},
"_enabled": true,
"alignMode": 1,
@ -10552,7 +10677,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 259
"__id__": 262
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"

View File

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

View File

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

View File

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

View File

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