修复变色门BUG
This commit is contained in:
parent
60275b790a
commit
a5dbb20adc
|
|
@ -513,12 +513,12 @@ export default class Wall extends cc.Component {
|
||||||
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); // 将第一项添加到数组末尾
|
||||||
this.updateColor();
|
|
||||||
}
|
}
|
||||||
else if (this.colorArray.length == 1 && this.color != this.colorArray[0]) {
|
// 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];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user