【内存优化】添加一些debug打印

dev_chengFeng
gaoxin 2021-04-22 09:46:59 +08:00
parent e277760221
commit 31ad3358bc
5 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,7 @@ function this.Close(sub)
sub:OnClose()
end
resMgr:UnLoadAsset(sub.assetName)
LogError("sub UI close: "..sub.assetName)
end

View File

@ -719,6 +719,7 @@ function UIManager.DelayDestroyPanel(panel)
end
function UIManager.DestroyPanel(panel)
LogError("Panel Destroy: "..panel.uiConfig.assetName)
panel:DestroyUI()
GameObject.Destroy(panel.gameObject)
resMgr:UnLoadAsset(panel.uiConfig.assetName)

View File

@ -32,6 +32,7 @@ end
-- 根据界面加载的数量卸载相应数量的资源
function SpriteLoader:UnLoadSprite()
for name, count in pairs(self.SpriteList) do
LogWarn("lua 回收资源name:"..name..", count:"..count)
resMgr:UnLoadAsset(name, count)
end
self.SpriteList = {}

View File

@ -149,6 +149,7 @@ function this:InitComponent()
this.mopUpGo:SetActive(false)
--元素共鸣
LogError("FormationPanelV2 Init")
this.ElementalResonanceView = SubUIManager.Open(SubUIConfig.ElementalResonanceView, this.gameObject.transform)
end
@ -261,6 +262,7 @@ function this:OnClose()
end
function this:OnDestroy()
LogError("FormationPanelV2 OnDestroy")
this.spLoader:Destroy()
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.ElementalResonanceView)

View File

@ -578,6 +578,7 @@ function this.Init()
if not sr then
sr = go.gameObject:AddComponent(typeof(UnityEngine.SpriteRenderer))
end
LogWarn("Lua Load map BG:".._mapConfig[_mapId].BGPath.."_"..count)
sr.sprite = this.spLoader:LoadSprite(_mapConfig[_mapId].BGPath.."_"..count)
end
end