miduo_client/Assets/ManagedResources/~Lua/Modules/Explore/ExplorePanel.lua

60 lines
1.7 KiB
Lua
Raw Normal View History

2021-12-22 12:07:00 +08:00
require("Base/BasePanel")
ExplorePanel = Inherit(BasePanel)
2021-12-24 00:33:33 +08:00
local this = ExplorePanel
2021-12-23 17:23:02 +08:00
-- 小地图
local fightMap = require("Modules/Fight/View/ExploreMapView")
2021-12-22 12:07:00 +08:00
--初始化组件(用于子类重写)
function ExplorePanel:InitComponent()
2021-12-23 13:09:34 +08:00
self.spLoader = SpriteLoader.New()
self.upView = SubUIManager.Open(SubUIConfig.UpView,self.gameObject.transform)
self.backBtn = Util.GetGameObject(self.gameObject, "btns/backBtn")
self.lookReward = Util.GetGameObject(self.gameObject, "btns/lookReward")
2021-12-23 17:23:02 +08:00
2021-12-24 09:37:31 +08:00
--fightMap:InitComponent(self.gameObject, this)
2021-12-22 12:07:00 +08:00
end
2021-12-24 00:33:33 +08:00
--绑定事件(用于子类重写
2021-12-22 12:07:00 +08:00
function ExplorePanel:BindEvent()
2021-12-23 13:09:34 +08:00
Util.AddClick(self.backBtn,function()
self:ClosePanel()
end)
Util.AddClick(self.lookReward,function()
UIManager.OpenPanel(UIName.ExploreRewardPopup,self.mapData.mapId)
end)
2021-12-22 12:07:00 +08:00
end
2021-12-24 00:33:33 +08:00
--添加事件监听(用于子类重
2021-12-22 12:07:00 +08:00
function ExplorePanel:AddListener()
2021-12-24 09:37:31 +08:00
--fightMap:AddListener()
2021-12-22 12:07:00 +08:00
end
--移除事件监听(用于子类重写)
function ExplorePanel:RemoveListener()
2021-12-24 09:37:31 +08:00
--fightMap:RemoveListener()
2021-12-22 12:07:00 +08:00
end
--界面打开时调用(用于子类重写)
2021-12-23 13:09:34 +08:00
function ExplorePanel:OnOpen(data)
self.mapData = data
2021-12-22 12:07:00 +08:00
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function ExplorePanel:OnShow()
2021-12-24 09:37:31 +08:00
--fightMap:Init()
2021-12-22 12:07:00 +08:00
end
--界面关闭时调用(用于子类重写)
function ExplorePanel:OnClose()
2021-12-24 09:37:31 +08:00
--fightMap:OnClose()
2021-12-23 17:23:02 +08:00
end
function ExplorePanel:OnSortingOrderChange()
2021-12-24 09:37:31 +08:00
--fightMap:OnSortingOrderChange(self.sortingOrder)
2021-12-22 12:07:00 +08:00
end
--界面销毁时调用(用于子类重写)
function ExplorePanel:OnDestroy()
2021-12-23 13:09:34 +08:00
SubUIManager.Close(self.upView)
self.upView = nil
self.spLoader:Destroy()
2021-12-22 12:07:00 +08:00
end
return ExplorePanel