Node.children.forEach()只能遍历奇数位的child,很稳定,for循环也一样。执行第二次可以访问到剩下的节点。
2.0.4实测没有问题

var newRoot = new cc.Node();
cc.director.getScene().addChild(newRoot);
newRoot.addChild(new cc.Node(“name_1”));
newRoot.addChild(new cc.Node(“name_2”));
newRoot.addChild(new cc.Node(“name_3”));
newRoot.addChild(new cc.Node(“name_4”));
newRoot.addChild(new cc.Node(“name_5”));
newRoot.addChild(new cc.Node(“name_6”));
console.log(“LENGTH”,newRoot.children.length);
newRoot.children.forEach(child=>{
console.log(child.name,“Destroy”);
try{
child.destroy();
}catch(exp){
console.log(exp);
}
});
