【战斗】====战斗gm报错修改

dev_chengFeng
wangzhenxing 2021-12-16 10:24:36 +08:00
parent 7c1a3caa5f
commit d9f1670993
3 changed files with 50 additions and 1 deletions

View File

@ -73,6 +73,16 @@ function this.Clear()
this.momItems = {}
end
function this.Clear2()
for _, st in pairs(this.pool) do
st:Foreach(function(item)
destroy(item)
end)
end
this.pool = {}
--this.momItems = {}
end
-- 销毁对象池
-- function this.Destroy()
-- this.Clear()

View File

@ -115,7 +115,7 @@ function this:BindEvent()
_IsStart = false
this.RoleSkillOption:SetActive(false)
BattleView.Clear()
BattleView:OnClose()
BattleView:OnClose2()
BattleView.InitBattleEvent()
this.RefreshAllRoleShow()

View File

@ -1023,6 +1023,45 @@ function this:OnClose()
this.ClearBattleEvent()
end
function this:OnClose2()
-- 回收所有延迟资源
BattleManager.RecycleAllDelayRes()
--
FixedUpdateBeat:Remove(this.OnUpdate, self)
-- 清空
this.Clear()
for _, v in pairs(tbRoleDispose) do
v:Dispose()
end
tbRoleDispose = {}
for _, v in pairs(tbMonsterDispose) do
v:Dispose()
end
tbMonsterDispose = {}
for k, v in pairs(delayRecycleList) do
for i=1, #v do
poolManager:UnLoadAsset(k, v[i], PoolManager.AssetType.GameObject)
end
delayRecycleList[k] = nil
end
BattlePool.Clear2()
poolManager:ClearPool()
this.mySkillCast:SetActive(false)
this.enemySkillCast:SetActive(false)
this.lingshouCastUp:SetActive(false)
this.lingshouCastDown:SetActive(false)
--
BattleManager.StopBattle()
this.ClearBattleEvent()
end
--界面销毁时调用(用于子类重写)