部分界面不再常驻内存

gaoxin 2020-09-10 14:25:02 +08:00
parent 49f0c19cea
commit 70a575cbb3
9 changed files with 59 additions and 7 deletions

View File

@ -750,6 +750,10 @@ function BagPanel:OnDestroy()
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView)
SubUIManager.Close(this.playerHead)
this.playerHead = nil
this.UpView = nil
this.BtView = nil
this.ScrollView = nil
this.ScrollView1 = nil
ClearRedPointObject(RedPointType.Bag_HeroDebris, tabs1RedPoint[ItemBaseType.HeroChip])

View File

@ -504,10 +504,16 @@ end
function CarbonTypePanelV2:OnDestroy()
hasFresh = false
if this.BtView then
SubUIManager.Close(this.BtView)
SubUIManager.Close(this.BtView)
end
carbons = {}
this.playerHead=nil
SubUIManager.Close(this.playerHead)
SubUIManager.Close(this.UpView)
this.playerHead = nil
this.UpView = nil
this.BtView = nil
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
for k,v in ipairs(carbons) do
local data

View File

@ -127,6 +127,9 @@ end
function CarbonTypePanelV3:OnDestroy()
hasFresh = false
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.playerHead)
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
end
return CarbonTypePanelV3

View File

@ -104,9 +104,9 @@ function ExpertPanel:BindEvent()
-- this.heroStarGift:BindEvent()
this.upLvRewardGrid:BindEvent()
Util.AddClick(self.btnBack, function()
--self:ClosePanel()
if this.isPlayingLackCatAni == false then
UIManager.OpenPanel(UIName.MainPanel)
-- UIManager.OpenPanel(UIName.MainPanel)
self:ClosePanel()
end
end)
for i = 1, allActivityNum do

View File

@ -84,9 +84,9 @@ function this.InitMsg(msg)
this.serData[id].endTime = endTime
this.serData[id].restTime = restTime
LogRed(
string.format("--- 功能解锁数据 id = %s, startTime = %s, endTime = %s",
id, startTime, endTime))
-- LogRed(
-- string.format("--- 功能解锁数据 id = %s, startTime = %s, endTime = %s",
-- id, startTime, endTime))
-- 用于标记是否解锁使用
local typeId = AllActSetConfig[id].IsIDdSame

View File

@ -574,6 +574,10 @@ function GuildMainCityPanel:OnDestroy()
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView)
SubUIManager.Close(this.playerHead)
this.ChatTipView = nil
this.playerHead = nil
this.UpView = nil
this.BtView = nil
-- 移除红点
for type, data in pairs(_GuildBuildConfig) do
if data.btnName then

View File

@ -379,12 +379,16 @@ end
--界面销毁时调用(用于子类重写)
function RoleListPanel:OnDestroy()
SubUIManager.Close(this.playerHead)
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView)
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
this.ScrollView = nil
this.playerHead = nil
this.UpView = nil
this.BtView = nil
end
return RoleListPanel

View File

@ -192,6 +192,10 @@ end
function VipPanelV2:OnDestroy()
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView)
SubUIManager.Close(this.playerHead)
this.playerHead = nil
this.UpView = nil
this.BtView = nil
end
function VipPanelV2:InitVipContext()

View File

@ -4,6 +4,10 @@ local bagPanelUI
local RoleListPanelUI
--- 静态数据
local static_openId = 0
-- 当前打开的界面
local _CurPanel = nil
function BtView:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -47,10 +51,24 @@ function this:InitComponent()
end
function this:CloseCurPanel()
if not _CurPanel then
return
end
-- 这界面不关闭
if _CurPanel == UIName.MainPanel or _CurPanel == UIName.FightPointPassMainPanel then
return
end
if UIManager.IsOpen(_CurPanel) then
UIManager.ClosePanel(_CurPanel, true)
end
end
-- 主城
function this:OPenMainCity()
if not UIManager.IsOpen(UIName.MainPanel) then
UIManager.OpenPanel(UIName.MainPanel)
_CurPanel = UIName.MainPanel
end
end
--打开英雄列表界面
@ -59,28 +77,34 @@ function this:OpenChengYuan()
HeroManager.heroListPanelSortID = 1
HeroManager.heroListPanelProID = 0
RoleListPanelUI = UIManager.OpenPanel(UIName.RoleListPanel)
_CurPanel = UIName.RoleListPanel
end
end
--打开仓库界面
function this:OpenCangKu()
if not UIManager.IsOpen(UIName.BagPanel) or (bagPanelUI and bagPanelUI.isFristOpen == false) then
bagPanelUI = UIManager.OpenPanel(UIName.BagPanel)
_CurPanel = UIName.BagPanel
end
end
-- 挂机界面
function this:OpenJieling()
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
_CurPanel = UIName.FightPointPassMainPanel
end
-- 打开副本选择界面
function this:OpenCarbon()
PlayerManager.carbonType = 1
UIManager.OpenPanel(UIName.CarbonTypePanelV2)
_CurPanel = UIName.CarbonTypePanelV2
end
function this:OpenGuild()
JumpManager.GoJump(4001)
_CurPanel = UIName.GuildMainCityPanel
end
function this:OpenVIP()
UIManager.OpenPanel(UIName.VipPanelV2)
_CurPanel = UIName.VipPanelV2
end
--绑定事件(用于子类重写)
@ -170,6 +194,9 @@ end
function this:OnBtnClick(pt)
local isOpen = self:CheckIsOpen(pt)
if isOpen then
-- 关闭当前界面
this:CloseCurPanel()
-- 打开新界面
local btnFunc = self._BtnConfig[pt].clickFunc
if btnFunc then
btnFunc(self)