修复变色门BUG

This commit is contained in:
COMPUTER\EDY 2025-10-22 19:02:17 +08:00
parent 60275b790a
commit a5dbb20adc

View File

@ -513,11 +513,11 @@ export default class Wall extends cc.Component {
if (this.colorArray.length > 1 && this.color == this.colorArray[0]) {
let firstItem = this.colorArray.shift(); // 移除第一项
this.colorArray.push(firstItem); // 将第一项添加到数组末尾
this.updateColor();
}
else if (this.colorArray.length == 1 && this.color != this.colorArray[0]) {
this.updateColor();
}
// else if (this.colorArray.length == 1 && this.color != this.colorArray[0]) {
// this.updateColor();
// }
this.updateColor();
}
updateColor() {