【对象池】偶现回收出现空物体,导致报错的问题

dev_chengFeng
gaoxin 2021-04-25 16:48:41 +08:00
parent 77955d6f9c
commit d48b6fc988
1 changed files with 3 additions and 4 deletions

View File

@ -202,9 +202,8 @@ function PoolManager:UnLoadAsset(resName,res, assetType)
-- and assetType ~= PoolManager.AssetType.MediaUI
--then
if assetType == PoolManager.AssetType.GameObject
and res ~= nil
and res.transform ~= nil
then
and res
and tostring(res) ~= "null" then
res.transform:SetParent(self.mPoolTrans)
if #pool.resList <= 5 then
table.insert(pool.resList,res)