this.nodePool = new cc.NodePool();
clearNode(){
while(this.node.childrenCount){
this.pool.put(this.node.children.shift());//使用该方法存入缓存池后,再次取出使用看不到
this.pool.put(this.node.children[0]);//使用该方法正常
}
console.log(this.node.childrenCount);
}
addNode(pos){
let node;
if (this.nodePool .size() > 0) {
node = this.pool.get();
} else {
node = new cc.Node();
node.addComponent(cc.Sprite);
helper.loadResImg(node,“public/paopao”);
}
node.parent = this.node;
node.position = pos;
}