//使用對象池創建盒子
1.對象池的使用
對象池創建箱子
? ? ? let box = Laya.Pool.getItemByCreateFun("dropBox", this.dropBox.create, this.dropBox);
2.設置位置
? ? ? ? box.pos(Math.random() * (Laya.stage.width - 100), -100);
3.添加父節點
? ? ? ? this._gameBox.addChild(box);
//使用對象池創建盒子
對象池創建箱子
? ? ? let box = Laya.Pool.getItemByCreateFun("dropBox", this.dropBox.create, this.dropBox);
? ? ? ? box.pos(Math.random() * (Laya.stage.width - 100), -100);
? ? ? ? this._gameBox.addChild(box);