部分界面不再常驻内存
parent
49f0c19cea
commit
70a575cbb3
|
|
@ -750,6 +750,10 @@ function BagPanel:OnDestroy()
|
||||||
|
|
||||||
SubUIManager.Close(this.UpView)
|
SubUIManager.Close(this.UpView)
|
||||||
SubUIManager.Close(this.BtView)
|
SubUIManager.Close(this.BtView)
|
||||||
|
SubUIManager.Close(this.playerHead)
|
||||||
|
this.playerHead = nil
|
||||||
|
this.UpView = nil
|
||||||
|
this.BtView = nil
|
||||||
this.ScrollView = nil
|
this.ScrollView = nil
|
||||||
this.ScrollView1 = nil
|
this.ScrollView1 = nil
|
||||||
ClearRedPointObject(RedPointType.Bag_HeroDebris, tabs1RedPoint[ItemBaseType.HeroChip])
|
ClearRedPointObject(RedPointType.Bag_HeroDebris, tabs1RedPoint[ItemBaseType.HeroChip])
|
||||||
|
|
|
||||||
|
|
@ -504,10 +504,16 @@ end
|
||||||
function CarbonTypePanelV2:OnDestroy()
|
function CarbonTypePanelV2:OnDestroy()
|
||||||
hasFresh = false
|
hasFresh = false
|
||||||
if this.BtView then
|
if this.BtView then
|
||||||
SubUIManager.Close(this.BtView)
|
SubUIManager.Close(this.BtView)
|
||||||
end
|
end
|
||||||
carbons = {}
|
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
|
for k,v in ipairs(carbons) do
|
||||||
local data
|
local data
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,9 @@ end
|
||||||
function CarbonTypePanelV3:OnDestroy()
|
function CarbonTypePanelV3:OnDestroy()
|
||||||
hasFresh = false
|
hasFresh = false
|
||||||
SubUIManager.Close(this.UpView)
|
SubUIManager.Close(this.UpView)
|
||||||
|
SubUIManager.Close(this.playerHead)
|
||||||
|
|
||||||
|
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
|
||||||
end
|
end
|
||||||
|
|
||||||
return CarbonTypePanelV3
|
return CarbonTypePanelV3
|
||||||
|
|
@ -104,9 +104,9 @@ function ExpertPanel:BindEvent()
|
||||||
-- this.heroStarGift:BindEvent()
|
-- this.heroStarGift:BindEvent()
|
||||||
this.upLvRewardGrid:BindEvent()
|
this.upLvRewardGrid:BindEvent()
|
||||||
Util.AddClick(self.btnBack, function()
|
Util.AddClick(self.btnBack, function()
|
||||||
--self:ClosePanel()
|
|
||||||
if this.isPlayingLackCatAni == false then
|
if this.isPlayingLackCatAni == false then
|
||||||
UIManager.OpenPanel(UIName.MainPanel)
|
-- UIManager.OpenPanel(UIName.MainPanel)
|
||||||
|
self:ClosePanel()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
for i = 1, allActivityNum do
|
for i = 1, allActivityNum do
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,9 @@ function this.InitMsg(msg)
|
||||||
this.serData[id].endTime = endTime
|
this.serData[id].endTime = endTime
|
||||||
this.serData[id].restTime = restTime
|
this.serData[id].restTime = restTime
|
||||||
|
|
||||||
LogRed(
|
-- LogRed(
|
||||||
string.format("--- 功能解锁数据 id = %s, startTime = %s, endTime = %s",
|
-- string.format("--- 功能解锁数据 id = %s, startTime = %s, endTime = %s",
|
||||||
id, startTime, endTime))
|
-- id, startTime, endTime))
|
||||||
|
|
||||||
-- 用于标记是否解锁使用
|
-- 用于标记是否解锁使用
|
||||||
local typeId = AllActSetConfig[id].IsIDdSame
|
local typeId = AllActSetConfig[id].IsIDdSame
|
||||||
|
|
|
||||||
|
|
@ -574,6 +574,10 @@ function GuildMainCityPanel:OnDestroy()
|
||||||
SubUIManager.Close(this.UpView)
|
SubUIManager.Close(this.UpView)
|
||||||
SubUIManager.Close(this.BtView)
|
SubUIManager.Close(this.BtView)
|
||||||
SubUIManager.Close(this.playerHead)
|
SubUIManager.Close(this.playerHead)
|
||||||
|
this.ChatTipView = nil
|
||||||
|
this.playerHead = nil
|
||||||
|
this.UpView = nil
|
||||||
|
this.BtView = nil
|
||||||
-- 移除红点
|
-- 移除红点
|
||||||
for type, data in pairs(_GuildBuildConfig) do
|
for type, data in pairs(_GuildBuildConfig) do
|
||||||
if data.btnName then
|
if data.btnName then
|
||||||
|
|
|
||||||
|
|
@ -379,12 +379,16 @@ end
|
||||||
--界面销毁时调用(用于子类重写)
|
--界面销毁时调用(用于子类重写)
|
||||||
function RoleListPanel:OnDestroy()
|
function RoleListPanel:OnDestroy()
|
||||||
|
|
||||||
|
SubUIManager.Close(this.playerHead)
|
||||||
SubUIManager.Close(this.UpView)
|
SubUIManager.Close(this.UpView)
|
||||||
SubUIManager.Close(this.BtView)
|
SubUIManager.Close(this.BtView)
|
||||||
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
|
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
|
||||||
ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
|
ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
|
||||||
|
|
||||||
this.ScrollView = nil
|
this.ScrollView = nil
|
||||||
|
this.playerHead = nil
|
||||||
|
this.UpView = nil
|
||||||
|
this.BtView = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
return RoleListPanel
|
return RoleListPanel
|
||||||
|
|
@ -192,6 +192,10 @@ end
|
||||||
function VipPanelV2:OnDestroy()
|
function VipPanelV2:OnDestroy()
|
||||||
SubUIManager.Close(this.UpView)
|
SubUIManager.Close(this.UpView)
|
||||||
SubUIManager.Close(this.BtView)
|
SubUIManager.Close(this.BtView)
|
||||||
|
SubUIManager.Close(this.playerHead)
|
||||||
|
this.playerHead = nil
|
||||||
|
this.UpView = nil
|
||||||
|
this.BtView = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function VipPanelV2:InitVipContext()
|
function VipPanelV2:InitVipContext()
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ local bagPanelUI
|
||||||
local RoleListPanelUI
|
local RoleListPanelUI
|
||||||
--- 静态数据
|
--- 静态数据
|
||||||
local static_openId = 0
|
local static_openId = 0
|
||||||
|
|
||||||
|
-- 当前打开的界面
|
||||||
|
local _CurPanel = nil
|
||||||
|
|
||||||
function BtView:New(gameObject)
|
function BtView:New(gameObject)
|
||||||
local b = {}
|
local b = {}
|
||||||
b.gameObject = gameObject
|
b.gameObject = gameObject
|
||||||
|
|
@ -47,10 +51,24 @@ function this:InitComponent()
|
||||||
|
|
||||||
end
|
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()
|
function this:OPenMainCity()
|
||||||
if not UIManager.IsOpen(UIName.MainPanel) then
|
if not UIManager.IsOpen(UIName.MainPanel) then
|
||||||
UIManager.OpenPanel(UIName.MainPanel)
|
UIManager.OpenPanel(UIName.MainPanel)
|
||||||
|
_CurPanel = UIName.MainPanel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--打开英雄列表界面
|
--打开英雄列表界面
|
||||||
|
|
@ -59,28 +77,34 @@ function this:OpenChengYuan()
|
||||||
HeroManager.heroListPanelSortID = 1
|
HeroManager.heroListPanelSortID = 1
|
||||||
HeroManager.heroListPanelProID = 0
|
HeroManager.heroListPanelProID = 0
|
||||||
RoleListPanelUI = UIManager.OpenPanel(UIName.RoleListPanel)
|
RoleListPanelUI = UIManager.OpenPanel(UIName.RoleListPanel)
|
||||||
|
_CurPanel = UIName.RoleListPanel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--打开仓库界面
|
--打开仓库界面
|
||||||
function this:OpenCangKu()
|
function this:OpenCangKu()
|
||||||
if not UIManager.IsOpen(UIName.BagPanel) or (bagPanelUI and bagPanelUI.isFristOpen == false) then
|
if not UIManager.IsOpen(UIName.BagPanel) or (bagPanelUI and bagPanelUI.isFristOpen == false) then
|
||||||
bagPanelUI = UIManager.OpenPanel(UIName.BagPanel)
|
bagPanelUI = UIManager.OpenPanel(UIName.BagPanel)
|
||||||
|
_CurPanel = UIName.BagPanel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- 挂机界面
|
-- 挂机界面
|
||||||
function this:OpenJieling()
|
function this:OpenJieling()
|
||||||
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
|
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
|
||||||
|
_CurPanel = UIName.FightPointPassMainPanel
|
||||||
end
|
end
|
||||||
-- 打开副本选择界面
|
-- 打开副本选择界面
|
||||||
function this:OpenCarbon()
|
function this:OpenCarbon()
|
||||||
PlayerManager.carbonType = 1
|
PlayerManager.carbonType = 1
|
||||||
UIManager.OpenPanel(UIName.CarbonTypePanelV2)
|
UIManager.OpenPanel(UIName.CarbonTypePanelV2)
|
||||||
|
_CurPanel = UIName.CarbonTypePanelV2
|
||||||
end
|
end
|
||||||
function this:OpenGuild()
|
function this:OpenGuild()
|
||||||
JumpManager.GoJump(4001)
|
JumpManager.GoJump(4001)
|
||||||
|
_CurPanel = UIName.GuildMainCityPanel
|
||||||
end
|
end
|
||||||
function this:OpenVIP()
|
function this:OpenVIP()
|
||||||
UIManager.OpenPanel(UIName.VipPanelV2)
|
UIManager.OpenPanel(UIName.VipPanelV2)
|
||||||
|
_CurPanel = UIName.VipPanelV2
|
||||||
end
|
end
|
||||||
|
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
|
|
@ -170,6 +194,9 @@ end
|
||||||
function this:OnBtnClick(pt)
|
function this:OnBtnClick(pt)
|
||||||
local isOpen = self:CheckIsOpen(pt)
|
local isOpen = self:CheckIsOpen(pt)
|
||||||
if isOpen then
|
if isOpen then
|
||||||
|
-- 关闭当前界面
|
||||||
|
this:CloseCurPanel()
|
||||||
|
-- 打开新界面
|
||||||
local btnFunc = self._BtnConfig[pt].clickFunc
|
local btnFunc = self._BtnConfig[pt].clickFunc
|
||||||
if btnFunc then
|
if btnFunc then
|
||||||
btnFunc(self)
|
btnFunc(self)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue