【战斗】修复战斗界面资源回收时报错

dev_chengFeng
gaoxin 2020-11-02 22:09:37 +08:00
parent 355d843b30
commit 9dc9ca2b2a
2 changed files with 6 additions and 2 deletions

View File

@ -792,14 +792,14 @@ function this.AddDelayRecycleRes(path, go, delayTime, delayFunc)
end
function this.RecycleAllDelayRes()
--立即回收延迟列表上的资源
for k, v in pairs(this._delayRecycleList) do
for i=1, #v do
Util.SetGray(v[i], false)
poolManager:UnLoadAsset(k, v[i], PoolManager.AssetType.GameObject)
end
this._delayRecycleList[k] = nil
end
this._delayRecycleList = {}
end
--++++++++++++++

View File

@ -891,6 +891,9 @@ function this:OnClose()
delayRecycleList[k] = nil
end
-- 回收所有延迟资源
BattleManager.RecycleAllDelayRes()
BattlePool.Clear()
poolManager:ClearPool()
@ -902,6 +905,7 @@ function this:OnClose()
BattleManager.StopBattle()
this.ClearBattleEvent()
end
--界面销毁时调用(用于子类重写)