diff --git a/assets/Script/Wall.ts b/assets/Script/Wall.ts index 0b1d355..6f0603c 100644 --- a/assets/Script/Wall.ts +++ b/assets/Script/Wall.ts @@ -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; diff --git a/assets/resources/prefab/wall/down.prefab b/assets/resources/prefab/wall/down.prefab index 20f1e2d..16e2a5b 100644 --- a/assets/resources/prefab/wall/down.prefab +++ b/assets/resources/prefab/wall/down.prefab @@ -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, diff --git a/assets/resources/prefab/wall/left.prefab b/assets/resources/prefab/wall/left.prefab index 8cae11a..9217128 100644 --- a/assets/resources/prefab/wall/left.prefab +++ b/assets/resources/prefab/wall/left.prefab @@ -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, diff --git a/assets/resources/prefab/wall/right.prefab b/assets/resources/prefab/wall/right.prefab index 0bf7a1e..6ee8f9f 100644 --- a/assets/resources/prefab/wall/right.prefab +++ b/assets/resources/prefab/wall/right.prefab @@ -638,7 +638,7 @@ "_prefab": { "__id__": 17 }, - "_opacity": 255, + "_opacity": 0, "_color": { "__type__": "cc.Color", "r": 255, diff --git a/assets/resources/prefab/wall/up.prefab b/assets/resources/prefab/wall/up.prefab index 794f802..763fc12 100644 --- a/assets/resources/prefab/wall/up.prefab +++ b/assets/resources/prefab/wall/up.prefab @@ -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, diff --git a/settings/project.json b/settings/project.json index 325b0ab..92f4ad3 100644 --- a/settings/project.json +++ b/settings/project.json @@ -1,5 +1,5 @@ { - "last-module-event-record-time": 1760668791397, + "last-module-event-record-time": 1761280830123, "group-list": [ "default", "Map"