【已解决】cleanAllItem方法里用从0开始遍历会有格子清理不掉
老师您好, 我在cleanAllItem方法里用从0开始的遍历不行,会有格子清理不掉。用视频里的方法就行,这是为什么
private cleanItem() {
let children = this.nodeParent.children;
for (let i = 0; i < children.length; i++) {
let tile = children[i].getComponent(Tile);
if (tile) {
this.nodeParent.removeChild(children[i]);
}
}
}
