为了学习Laya.Pool.getItemByClass 和 Laya.Pool.recover ,做了一个简单的测试,代码如下:
//从POOL里获取BackGround对象
var bg1:BackGround= Laya.Pool.getItemByClass("mybg",BackGround);
Laya.stage.addChild(bg1);
console.log("bg1->",bg1);
//对象放回Pool里,并清除对象
Laya.Pool.recover("mybg",BackGround);
bg1.removeSelf();
Laya.stage.removeChild(bg1);
console.log("bg1->",bg1);
//再次从Pool里获取对象的时候,就报错了
var bg2:BackGround= Laya.Pool.getItemByClass("mybg",BackGround);
Laya.stage.addChild(bg2);
console.log("bg2->",bg2);
结果执行的时候就报错如下:

然后查看_style报错的情况,发现报错在laya.core.js里面,结果如下:

是引擎的原因?还是我使用方法不对?求解答!我使用的laya引擎版本是:1.7.20beta