更新广告和墙壁

This commit is contained in:
COMPUTER\EDY 2025-10-24 14:10:25 +08:00
parent 647d3c8884
commit 8708fa71cf
6 changed files with 29 additions and 24 deletions

View File

@ -434,11 +434,14 @@ export default class Wall extends cc.Component {
double = 3;
}
let color = this.colorArray[1];
if (this.wall_SpriteFrames) {
if (this.down_SpriteFrames) {
let name = color + "down" + (this.wall_Info.length + double);
var spriteFrame = this.down_SpriteFrames._spriteFrames[name];
this.maskNode.getChildByName("color_icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
}
this.maskNode.getChildByName("color_down").opacity = 255;
this.maskNode.getChildByName("color_icon").opacity = 0;
}
}
@ -448,6 +451,8 @@ export default class Wall extends cc.Component {
}
this.node.parent.getChildByName("down").active = false;
if (this.colorArray.length > 0) {
this.maskNode.getChildByName("color_down").opacity = 0;
this.maskNode.getChildByName("color_icon").opacity = 255;
let direction = this.node.parent.name;
let double = 0;
if (direction == "left" || direction == "right") {
@ -510,19 +515,17 @@ export default class Wall extends cc.Component {
//变色门变色具体执行方法
changeColor() {
console.log("变色门变色数组数量", this.colorArray.length);
if (this.colorArray.length > 1 && this.color == this.colorArray[0]) {
let firstItem = this.colorArray.shift(); // 移除第一项
this.colorArray.push(firstItem); // 将第一项添加到数组末尾
}
// else if (this.colorArray.length == 1 && this.color != this.colorArray[0]) {
// this.updateColor();
// }
this.updateColor();
}
updateColor() {
this.color = this.colorArray[0];
// console.log("改變顏色", this.color, this.colorArray);
console.log("改變顏色", this.color);
// debugger;
let direction = this.node.parent.name;
let double = 0;
@ -535,7 +538,7 @@ export default class Wall extends cc.Component {
if (this.wall_SpriteFrames) {
let name = this.color + "color" + (this.wall_Info.length + double);
// console.log("变色名称:", name);
console.log("变色名称:", name);
var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
if (this.node.getComponent(cc.Sprite)) this.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
if (this.node.getChildByName("icon")) this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;

View File

@ -491,7 +491,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-7,
-1.84,
-39,
0,
0,
@ -555,7 +555,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
2,
0,
0,
0,
@ -638,7 +638,7 @@
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,
@ -648,8 +648,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138,
"height": 69
"width": 122,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -660,7 +660,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
5,
0,
0,
0,
@ -700,7 +700,9 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "dbf12764-e7df-4736-923b-4e613402fd70"
},
"_type": 3,
"_sizeMode": 1,
"_fillType": 0,

View File

@ -638,7 +638,7 @@
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,
@ -660,7 +660,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-4,
0,
0,
0,

View File

@ -638,7 +638,7 @@
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,

View File

@ -543,8 +543,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 258,
"height": 69
"width": 122,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -638,7 +638,7 @@
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,
@ -648,8 +648,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 258,
"height": 69
"width": 122,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -660,8 +660,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
3,
4.5,
0,
0,
0,

View File

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