更新预制体

This commit is contained in:
COMPUTER\EDY 2025-12-23 14:29:24 +08:00
parent bfe340508a
commit 9fe73bcce6
16 changed files with 170 additions and 51 deletions

View File

@ -2385,8 +2385,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 94, "width": 92,
"height": 90 "height": 88
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -2438,7 +2438,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "8470837f-e899-445f-b74c-ef594b344817" "__uuid__": "d1fb07ef-8763-4e07-b38f-63071b2d0ee4"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
@ -2451,9 +2451,7 @@
"_fillStart": 0, "_fillStart": 0,
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": { "_atlas": null,
"__uuid__": "98eb2872-691f-4fc7-b827-c7f6dd98d242"
},
"_id": "cdFSX2eQpLcoQo2xGNhbqy" "_id": "cdFSX2eQpLcoQo2xGNhbqy"
}, },
{ {
@ -2628,9 +2626,9 @@
"_opacity": 0, "_opacity": 0,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 109, "r": 0,
"g": 70, "g": 0,
"b": 70, "b": 0,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {

View File

@ -227,12 +227,7 @@ export default class Block extends cc.Component {
this.node.x - this.block_Info.node.x, this.node.x - this.block_Info.node.x,
this.node.y - this.block_Info.node.y this.node.y - this.block_Info.node.y
); );
if (createAd) {
if (this.node.zIndex >= this.block_Info.node.zIndex)
this.createAdhesive();
else
this.block_Info.node.getComponent("Block").createAdhesive();
}
const targetNames = ['top', 'down', 'left', 'right']; const targetNames = ['top', 'down', 'left', 'right'];
this.block_Info.node.children.forEach(child => { this.block_Info.node.children.forEach(child => {
if (child instanceof cc.Node && targetNames.includes(child.name) && child.getComponent("lq_collide").data_string != "-1") { if (child instanceof cc.Node && targetNames.includes(child.name) && child.getComponent("lq_collide").data_string != "-1") {
@ -248,7 +243,13 @@ export default class Block extends cc.Component {
); );
} }
}); });
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; this.adhesive = posOffset;
} }
}, 100); }, 100);
@ -620,13 +621,13 @@ export default class Block extends cc.Component {
this.node.x = mapBlock.x + 65; this.node.x = mapBlock.x + 65;
this.node.y = mapBlock.y - 60; this.node.y = mapBlock.y - 60;
if (this.type == 9) { // if (this.type == 9) {
if (this.block_Info.node) { // if (this.block_Info.node) {
this.block_Info.node.x = this.node.x - this.adhesive.x; // this.block_Info.node.x = this.node.x - this.adhesive.x;
this.block_Info.node.y = this.node.y - this.adhesive.y; // this.block_Info.node.y = this.node.y - this.adhesive.y;
} // }
} // }
else if (this.type == 1) { if (this.type == 1) {
this.block_Info.node.getComponent("Block").moveStack = false; this.block_Info.node.getComponent("Block").moveStack = false;
this.block_Info.node.x = this.node.x + this.block_Info.node.getComponent("Block").stacking.x; this.block_Info.node.x = this.node.x + this.block_Info.node.getComponent("Block").stacking.x;
this.block_Info.node.y = this.node.y + this.block_Info.node.getComponent("Block").stacking.y; this.block_Info.node.y = this.node.y + this.block_Info.node.getComponent("Block").stacking.y;

View File

@ -2008,6 +2008,14 @@ var GameTool = {
cc.fx.StorageMessage.setStorage("Avatar", Avatar); cc.fx.StorageMessage.setStorage("Avatar", Avatar);
return false; return false;
} }
},
// 数字缩放动画,缩放后回归正常形态 改变后再放大
numberScaleAction(node: cc.Node, scale = 1.2, duration = 0.2) {
node.scale = 1;
const scaleAction = cc.scaleTo(duration, scale).easing(cc.easeBackOut());
const reverseAction = cc.scaleTo(duration, 1).easing(cc.easeBackIn());
node.runAction(cc.sequence(scaleAction, reverseAction));
} }
}; };
export { GameTool }; export { GameTool };

View File

@ -69,6 +69,8 @@ export default class Adhesive extends cc.Component {
this.lockTime--; this.lockTime--;
NumberToImage.numberToImageNodes(this.lockTime, 20, 8, "time_", this.node.getChildByName("heng").getChildByName("num"), false); NumberToImage.numberToImageNodes(this.lockTime, 20, 8, "time_", this.node.getChildByName("heng").getChildByName("num"), false);
NumberToImage.numberToImageNodes(this.lockTime, 20, 8, "time_", this.node.getChildByName("shu").getChildByName("num"), false); NumberToImage.numberToImageNodes(this.lockTime, 20, 8, "time_", this.node.getChildByName("shu").getChildByName("num"), false);
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("heng").getChildByName("num"));
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("shu").getChildByName("num"));
if (this.lockTime == 0) { if (this.lockTime == 0) {
this.target.getComponent("Block").removeSpecailAdhesive(false); this.target.getComponent("Block").removeSpecailAdhesive(false);
} }

View File

@ -31,7 +31,18 @@ export default class Boom extends cc.Component {
init(time) { init(time) {
if (time) this.time = time; if (time) this.time = time;
this.node.getChildByName("time").active = true; this.node.getChildByName("time").active = true;
if (this.node.name == "boom") {
NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
}
else if (this.node.name == "boom2") {
NumberToImage.numberToImageNodes(this.time, 26, 8, "half_black_", this.node.getChildByName("time"), false);
if (this.node.getChildByName("time").children.length > 1) {
this.node.getChildByName("time").children[0].scale = 0.7;
this.node.getChildByName("time").children[1].scale = 0.7;
this.node.getChildByName("time").children[0].x -= 2;
this.node.getChildByName("time").children[0].x -= 3;
}
}
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
} }
@ -47,7 +58,14 @@ export default class Boom extends cc.Component {
if (this.node.name == "boom2") { if (this.node.name == "boom2") {
this.time -= num; this.time -= num;
if (this.time <= 0) this.time = 0; if (this.time <= 0) this.time = 0;
NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 30, 8, "half_black_", this.node.getChildByName("time"), false);
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time").children[0]);
if (this.node.getChildByName("time").children.length > 1) {
this.node.getChildByName("time").children[0].scale = 0.7;
this.node.getChildByName("time").children[1].scale = 0.7;
this.node.getChildByName("time").children[0].x -= 2;
this.node.getChildByName("time").children[0].x -= 3;
}
if (this.time <= 0) { if (this.time <= 0) {
const mockTouchEvent = { const mockTouchEvent = {
getLocation: () => { getLocation: () => {
@ -110,7 +128,20 @@ export default class Boom extends cc.Component {
} }
} }
this.time--; this.time--;
if (this.node.name == "boom") {
NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
if (this.time < 10)
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time"));
}
else if (this.node.name == "boom2") {
NumberToImage.numberToImageNodes(this.time, 30, 8, "half_black_", this.node.getChildByName("time"), false);
if (this.node.getChildByName("time").children.length > 1) {
this.node.getChildByName("time").children[0].scale = 0.7;
this.node.getChildByName("time").children[1].scale = 0.7;
this.node.getChildByName("time").children[0].x -= 2;
this.node.getChildByName("time").children[0].x -= 3;
}
}
if (this.time <= 0) { if (this.time <= 0) {
// 创建模拟触摸事件对象 // 创建模拟触摸事件对象
const mockTouchEvent = { const mockTouchEvent = {

View File

@ -46,6 +46,7 @@ export default class Floor extends cc.Component {
this.time -= number; this.time -= number;
if (this.time <= 0) this.time = 0 if (this.time <= 0) this.time = 0
NumberToImage.numberToImageNodes(this.time, 30, 15, "level_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 30, 15, "level_", this.node.getChildByName("time"), false);
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time"));
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
if (this.time <= 0) { if (this.time <= 0) {
this.node.getChildByName("bingkuai").active = true; this.node.getChildByName("bingkuai").active = true;

View File

@ -50,6 +50,7 @@ export default class Freeze extends cc.Component {
this.time -= number; this.time -= number;
if (this.time <= 0) this.time = 0 if (this.time <= 0) this.time = 0
NumberToImage.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time"));
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
if (this.time <= 0) { if (this.time <= 0) {
this.node.getChildByName("bingkuai").active = true; this.node.getChildByName("bingkuai").active = true;

View File

@ -36,6 +36,7 @@ export default class Key extends cc.Component {
updateTime() { updateTime() {
this.time--; this.time--;
this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time"));
if (this.time <= 0) { if (this.time <= 0) {
this.unschedule(this.updateTime); this.unschedule(this.updateTime);
this.node.destroy(); this.node.destroy();

View File

@ -37,6 +37,7 @@ export default class Lock extends cc.Component {
reduce() { reduce() {
this.time -= 1; this.time -= 1;
NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time"));
if (this.time <= 0) { if (this.time <= 0) {
if (this.type == "block") { if (this.type == "block") {
if (this.node.parent) this.node.parent.getComponent("Block").type = 0; if (this.node.parent) this.node.parent.getComponent("Block").type = 0;

View File

@ -50,8 +50,9 @@ export default class Question extends cc.Component {
this.time -= number; this.time -= number;
if (this.time <= 0) this.time = 0 if (this.time <= 0) this.time = 0
NumberToImage.numberToImageNodes(this.time, 40, 25, "pc_num_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 40, 25, "pc_num_", this.node.getChildByName("time"), false);
this.node.getChildByName("time").scaleX = 1.2; cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time"));
this.node.getChildByName("time").scaleY = 1.2; // this.node.getChildByName("time").scaleX = 1.2;
// this.node.getChildByName("time").scaleY = 1.2;
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
if (this.time <= 0) { if (this.time <= 0) {
this.node.getChildByName("bingkuai").active = true; this.node.getChildByName("bingkuai").active = true;

BIN
assets/UI/UI/boom2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "8959ad5f-c8d7-4053-810a-b1ad9c8f2451",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"boom2": {
"ver": "1.0.6",
"uuid": "4c20b06a-6507-495a-a583-1b58aa0707df",
"importer": "sprite-frame",
"rawTextureUuid": "8959ad5f-c8d7-4053-810a-b1ad9c8f2451",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 8,
"trimY": 3,
"width": 84,
"height": 94,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

BIN
assets/UI/UI/xin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

38
assets/UI/UI/xin.png.meta Normal file
View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "c87c6881-83b8-4046-a9b1-ca0ccc0b4e76",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 92,
"height": 88,
"platformSettings": {},
"subMetas": {
"xin": {
"ver": "1.0.6",
"uuid": "d1fb07ef-8763-4e07-b38f-63071b2d0ee4",
"importer": "sprite-frame",
"rawTextureUuid": "c87c6881-83b8-4046-a9b1-ca0ccc0b4e76",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 92,
"height": 88,
"rawWidth": 92,
"rawHeight": 88,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -107,14 +107,14 @@
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 29, "g": 255,
"b": 29, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 62, "width": 84,
"height": 95 "height": 94
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -125,8 +125,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0.614, 8.842,
15.971, 6.242,
0, 0,
0, 0,
0, 0,
@ -166,7 +166,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "e22aadda-4f7e-403a-a1e6-d5374fc2862a" "__uuid__": "4c20b06a-6507-495a-a583-1b58aa0707df"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
@ -179,9 +179,7 @@
"_fillStart": 0, "_fillStart": 0,
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": { "_atlas": null,
"__uuid__": "d2adfa00-68ea-4d63-97a0-44fca153a2d7"
},
"_id": "" "_id": ""
}, },
{ {
@ -192,7 +190,7 @@
"asset": { "asset": {
"__id__": 0 "__id__": 0
}, },
"fileId": "4ahWLpW2tD8LfIbT5i2bbo", "fileId": "61CoqNIAZGc5WgJzkmhnWq",
"sync": false "sync": false
}, },
{ {

View File

@ -1,5 +1,5 @@
{ {
"last-module-event-record-time": 1765768067604, "last-module-event-record-time": 1766388151502,
"group-list": [ "group-list": [
"default", "default",
"Map" "Map"