更新广告和墙壁
This commit is contained in:
parent
647d3c8884
commit
8708fa71cf
|
|
@ -434,11 +434,14 @@ export default class Wall extends cc.Component {
|
||||||
double = 3;
|
double = 3;
|
||||||
}
|
}
|
||||||
let color = this.colorArray[1];
|
let color = this.colorArray[1];
|
||||||
if (this.wall_SpriteFrames) {
|
|
||||||
|
if (this.down_SpriteFrames) {
|
||||||
let name = color + "down" + (this.wall_Info.length + double);
|
let name = color + "down" + (this.wall_Info.length + double);
|
||||||
var spriteFrame = this.down_SpriteFrames._spriteFrames[name];
|
var spriteFrame = this.down_SpriteFrames._spriteFrames[name];
|
||||||
this.maskNode.getChildByName("color_icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
|
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;
|
this.node.parent.getChildByName("down").active = false;
|
||||||
if (this.colorArray.length > 0) {
|
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 direction = this.node.parent.name;
|
||||||
let double = 0;
|
let double = 0;
|
||||||
if (direction == "left" || direction == "right") {
|
if (direction == "left" || direction == "right") {
|
||||||
|
|
@ -510,19 +515,17 @@ export default class Wall extends cc.Component {
|
||||||
|
|
||||||
//变色门变色具体执行方法
|
//变色门变色具体执行方法
|
||||||
changeColor() {
|
changeColor() {
|
||||||
|
console.log("变色门变色数组数量", this.colorArray.length);
|
||||||
if (this.colorArray.length > 1 && this.color == this.colorArray[0]) {
|
if (this.colorArray.length > 1 && this.color == this.colorArray[0]) {
|
||||||
let firstItem = this.colorArray.shift(); // 移除第一项
|
let firstItem = this.colorArray.shift(); // 移除第一项
|
||||||
this.colorArray.push(firstItem); // 将第一项添加到数组末尾
|
this.colorArray.push(firstItem); // 将第一项添加到数组末尾
|
||||||
}
|
}
|
||||||
// else if (this.colorArray.length == 1 && this.color != this.colorArray[0]) {
|
|
||||||
// this.updateColor();
|
|
||||||
// }
|
|
||||||
this.updateColor();
|
this.updateColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateColor() {
|
updateColor() {
|
||||||
this.color = this.colorArray[0];
|
this.color = this.colorArray[0];
|
||||||
// console.log("改變顏色", this.color, this.colorArray);
|
console.log("改變顏色", this.color);
|
||||||
// debugger;
|
// debugger;
|
||||||
let direction = this.node.parent.name;
|
let direction = this.node.parent.name;
|
||||||
let double = 0;
|
let double = 0;
|
||||||
|
|
@ -535,7 +538,7 @@ export default class Wall extends cc.Component {
|
||||||
|
|
||||||
if (this.wall_SpriteFrames) {
|
if (this.wall_SpriteFrames) {
|
||||||
let name = this.color + "color" + (this.wall_Info.length + double);
|
let name = this.color + "color" + (this.wall_Info.length + double);
|
||||||
// console.log("变色名称:", name);
|
console.log("变色名称:", name);
|
||||||
var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
|
var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
|
||||||
if (this.node.getComponent(cc.Sprite)) this.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
|
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;
|
if (this.node.getChildByName("icon")) this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@
|
||||||
"__type__": "TypedArray",
|
"__type__": "TypedArray",
|
||||||
"ctor": "Float64Array",
|
"ctor": "Float64Array",
|
||||||
"array": [
|
"array": [
|
||||||
-7,
|
-1.84,
|
||||||
-39,
|
-39,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
@ -555,7 +555,7 @@
|
||||||
"__type__": "TypedArray",
|
"__type__": "TypedArray",
|
||||||
"ctor": "Float64Array",
|
"ctor": "Float64Array",
|
||||||
"array": [
|
"array": [
|
||||||
0,
|
2,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
@ -638,7 +638,7 @@
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 17
|
"__id__": 17
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 0,
|
||||||
"_color": {
|
"_color": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 255,
|
"r": 255,
|
||||||
|
|
@ -648,8 +648,8 @@
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 138,
|
"width": 122,
|
||||||
"height": 69
|
"height": 45
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
|
@ -660,7 +660,7 @@
|
||||||
"__type__": "TypedArray",
|
"__type__": "TypedArray",
|
||||||
"ctor": "Float64Array",
|
"ctor": "Float64Array",
|
||||||
"array": [
|
"array": [
|
||||||
0,
|
5,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
@ -700,7 +700,9 @@
|
||||||
],
|
],
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
"_dstBlendFactor": 771,
|
"_dstBlendFactor": 771,
|
||||||
"_spriteFrame": null,
|
"_spriteFrame": {
|
||||||
|
"__uuid__": "dbf12764-e7df-4736-923b-4e613402fd70"
|
||||||
|
},
|
||||||
"_type": 3,
|
"_type": 3,
|
||||||
"_sizeMode": 1,
|
"_sizeMode": 1,
|
||||||
"_fillType": 0,
|
"_fillType": 0,
|
||||||
|
|
|
||||||
|
|
@ -638,7 +638,7 @@
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 17
|
"__id__": 17
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 0,
|
||||||
"_color": {
|
"_color": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 255,
|
"r": 255,
|
||||||
|
|
@ -660,7 +660,7 @@
|
||||||
"__type__": "TypedArray",
|
"__type__": "TypedArray",
|
||||||
"ctor": "Float64Array",
|
"ctor": "Float64Array",
|
||||||
"array": [
|
"array": [
|
||||||
0,
|
-4,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
|
||||||
|
|
@ -638,7 +638,7 @@
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 17
|
"__id__": 17
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 0,
|
||||||
"_color": {
|
"_color": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 255,
|
"r": 255,
|
||||||
|
|
|
||||||
|
|
@ -543,8 +543,8 @@
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 258,
|
"width": 122,
|
||||||
"height": 69
|
"height": 45
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
|
@ -638,7 +638,7 @@
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 17
|
"__id__": 17
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 0,
|
||||||
"_color": {
|
"_color": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 255,
|
"r": 255,
|
||||||
|
|
@ -648,8 +648,8 @@
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 258,
|
"width": 122,
|
||||||
"height": 69
|
"height": 45
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
|
@ -660,8 +660,8 @@
|
||||||
"__type__": "TypedArray",
|
"__type__": "TypedArray",
|
||||||
"ctor": "Float64Array",
|
"ctor": "Float64Array",
|
||||||
"array": [
|
"array": [
|
||||||
0,
|
3,
|
||||||
0,
|
4.5,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"last-module-event-record-time": 1760668791397,
|
"last-module-event-record-time": 1761280830123,
|
||||||
"group-list": [
|
"group-list": [
|
||||||
"default",
|
"default",
|
||||||
"Map"
|
"Map"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user