413 lines
20 KiB
Lua
413 lines
20 KiB
Lua
require("Base/BasePanel")
|
|
FindTreasureMainPanel = Inherit(BasePanel)
|
|
local findTreasureGrid = {}
|
|
local findTreasureItemsGrid = {}
|
|
local timer = Timer.New()
|
|
local missionInfo = {}
|
|
local refreshIsMaterial = true
|
|
local isRefreshAddNum = false
|
|
local orginLayer = 0
|
|
local isFirstOpen
|
|
|
|
local starImage={[1]="x_xunbao_xingxingkong",[2]="ui_1xing"}--星星资源名
|
|
--初始化组件(用于子类重写)
|
|
function FindTreasureMainPanel:InitComponent()
|
|
|
|
self.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
|
|
self.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn")
|
|
self.helpPos = Util.GetGameObject(self.gameObject, "helpBtn"):GetComponent("RectTransform").localPosition
|
|
self.findTreasureVipBtn = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn")
|
|
self.findTreasureVipBtnRedPoint = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/redPoint")
|
|
self.allGetBtn = Util.GetGameObject(self.gameObject, "allGetBtn")
|
|
self.findTreasureGridGo = Util.GetGameObject(self.gameObject, "rect/rect (1)/grid")
|
|
self.rewardPre = Util.GetGameObject(self.gameObject, "rewardPre")
|
|
for i = 1, 2 do
|
|
findTreasureGrid[i] = Util.GetGameObject(self.gameObject, "rect/rect (1)/grid/rewardPre ("..i..")")
|
|
local curexpertRewardItemsGri = {}
|
|
for j = 1, 4 do
|
|
curexpertRewardItemsGri[j] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(findTreasureGrid[i], "content").transform)
|
|
end
|
|
findTreasureItemsGrid[i] = curexpertRewardItemsGri
|
|
end
|
|
self.FindTreasureVipIcon = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/icon"):GetComponent("Image")
|
|
self.FindTreasureVipTextIcon = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/icon/icon (1)"):GetComponent("Image")
|
|
self.FindTreasureVipText = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/Text"):GetComponent("Text")
|
|
self.FindTreasureVipEffect = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/FindTreasureVipEffect")
|
|
|
|
self.refreshBtn = Util.GetGameObject(self.gameObject, "refreshBtn")
|
|
self.refreshBtnText = Util.GetGameObject(self.gameObject, "refreshBtn/Text")
|
|
self.refreshImageGo = Util.GetGameObject(self.gameObject, "refreshBtn/refreshImage")
|
|
self.refreshBtnNumText = Util.GetGameObject(self.gameObject, "refreshBtn/refreshImage/numText"):GetComponent("Text")
|
|
self.refreshBtnImage = Util.GetGameObject(self.gameObject, "refreshBtn/refreshImage"):GetComponent("Image")
|
|
|
|
self.materialImageBg = Util.GetGameObject(self.gameObject, "materialImageBg")
|
|
self.materialImageNumText = Util.GetGameObject(self.gameObject, "materialImageBg/materialImage/numText"):GetComponent("Text")
|
|
self.materialImage = Util.GetGameObject(self.gameObject, "materialImageBg/materialImage"):GetComponent("Image")
|
|
|
|
self.refreshObj = Util.GetGameObject(self.gameObject, "refreshObj")
|
|
self.refreshNumText = Util.GetGameObject(self.gameObject, "refreshObj/numText"):GetComponent("Text")
|
|
self.refreshImage = Util.GetGameObject(self.gameObject, "refreshObj/refreshImage"):GetComponent("Image")
|
|
orginLayer = 0
|
|
end
|
|
|
|
--绑定事件(用于子类重写)
|
|
function FindTreasureMainPanel:BindEvent()
|
|
|
|
Util.AddClick(self.btnBack, function()
|
|
self:ClosePanel()
|
|
end)
|
|
Util.AddClick(self.materialImageBg, function()
|
|
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, FindTreasureManager.materialItemId)
|
|
end)
|
|
Util.AddClick(self.refreshObj, function()
|
|
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, ConfigManager.GetConfigData(ConfigName.MazeTreasureSetting,1).RefreshItem[1])
|
|
end)
|
|
Util.AddClick(self.helpBtn, function()
|
|
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.FindTreasure,Util.GetGameObject(self.gameObject, "helpBtn"):GetComponent("RectTransform").localPosition.x,Util.GetGameObject(self.gameObject, "helpBtn"):GetComponent("RectTransform").localPosition.y)
|
|
end)
|
|
Util.AddClick(self.findTreasureVipBtn, function()
|
|
UIManager.OpenPanel(UIName.FindTreasureVipPopup)
|
|
FindTreasureManager.SetShowFindTreasureVipRedPoint(false)
|
|
self.findTreasureVipBtnRedPoint:SetActive(FindTreasureManager.GetShowFindTreasureVipRedPoint())
|
|
end)
|
|
Util.AddClick(self.refreshBtn, function()
|
|
if refreshIsMaterial then
|
|
local isShowTwo = false
|
|
for i = 1, #missionInfo do
|
|
if missionInfo[i].state ~= 2 then
|
|
if ConfigManager.GetConfigData(ConfigName.MazeTreasure,math.floor(missionInfo[i].missionId%10000)).TaskType >= 4
|
|
and #missionInfo[i].heroId <= 0 then
|
|
isShowTwo = true
|
|
end
|
|
end
|
|
end
|
|
if isShowTwo then
|
|
MsgPanel.ShowTwo(Language[10661], nil, function()
|
|
NetManager.FindTreasureRefreshRequest(function(msg)
|
|
TaskManager.RefreshFindTreasureData(msg)
|
|
if isRefreshAddNum then
|
|
PlayerManager.missingRefreshCount = PlayerManager.missingRefreshCount + 1
|
|
end
|
|
self:OnShowPanelData(true)
|
|
end)
|
|
end, nil, nil, nil)
|
|
else
|
|
NetManager.FindTreasureRefreshRequest(function(msg)
|
|
TaskManager.RefreshFindTreasureData(msg)
|
|
if isRefreshAddNum then
|
|
PlayerManager.missingRefreshCount = PlayerManager.missingRefreshCount + 1
|
|
end
|
|
self:OnShowPanelData(true)
|
|
end)
|
|
end
|
|
else
|
|
PopupTipPanel.ShowTip(Language[10455])
|
|
end
|
|
end)
|
|
Util.AddClick(self.allGetBtn, function()
|
|
local allGetMissionData = {}
|
|
for i = 1, #missionInfo do
|
|
if missionInfo[i].state == 1 then
|
|
table.insert(allGetMissionData,missionInfo[i])
|
|
end
|
|
end
|
|
if #allGetMissionData > 0 then
|
|
NetManager.TakeMissionRewardRequest(TaskTypeDef.FindTreasure,0, function(msg)
|
|
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
|
end)
|
|
--刷新界面
|
|
for i = 1, #allGetMissionData do
|
|
--Log("missionInfo[i].missionId "..allGetMissionData[i].missionId)
|
|
TaskManager.RefreshFindTreasureStatrData(allGetMissionData[i].missionId,2)
|
|
end
|
|
self:OnShowPanelData(true)
|
|
end)
|
|
else
|
|
PopupTipPanel.ShowTip(Language[10662])
|
|
end
|
|
end)
|
|
end
|
|
|
|
--添加事件监听(用于子类重写)
|
|
function FindTreasureMainPanel:AddListener()
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.FindTreasure.RefreshFindTreasure, self.OnShowPanelData,self)
|
|
end
|
|
|
|
--移除事件监听(用于子类重写)
|
|
function FindTreasureMainPanel:RemoveListener()
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.FindTreasure.RefreshFindTreasure, self.OnShowPanelData,self)
|
|
end
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
function FindTreasureMainPanel:OnOpen(...)
|
|
|
|
isFirstOpen = true
|
|
end
|
|
|
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
|
function FindTreasureMainPanel:OnShow()
|
|
|
|
self:OnShowPanelData(true)
|
|
end
|
|
function FindTreasureMainPanel:OnSortingOrderChange()
|
|
--特效穿透签到
|
|
for i = 1, #findTreasureItemsGrid do
|
|
for j = 1, #findTreasureItemsGrid[i] do
|
|
findTreasureItemsGrid[i][j]:SetEffectLayer(self.sortingOrder)
|
|
end
|
|
end
|
|
Util.AddParticleSortLayer(self.FindTreasureVipEffect, self.sortingOrder - orginLayer)
|
|
orginLayer = self.sortingOrder
|
|
end
|
|
function FindTreasureMainPanel:OnShowPanelData(isSort)
|
|
refreshIsMaterial = true
|
|
isRefreshAddNum = false
|
|
TaskManager.SetFindTreasureDataState()
|
|
missionInfo = TaskManager.GetTypeTaskList(TaskTypeDef.FindTreasure)
|
|
if missionInfo == nil then return end
|
|
-- Log("#missionInfo "..#missionInfo)
|
|
if isSort then
|
|
self:MissionInfoSort(missionInfo)
|
|
end
|
|
for i = 1, math.max(#missionInfo, #findTreasureGrid) do
|
|
local go = findTreasureGrid[i]
|
|
if not go then
|
|
go = newObject(self.rewardPre)
|
|
go.transform:SetParent(self.findTreasureGridGo.transform)
|
|
go.transform.localScale = Vector3.one
|
|
go.transform.localPosition = Vector3.zero
|
|
go.name = "rewardPre ("..i..")"
|
|
findTreasureGrid[i] = go
|
|
findTreasureItemsGrid[i] = {}
|
|
end
|
|
go.gameObject:SetActive(false)
|
|
end
|
|
for i = 1, #missionInfo do
|
|
self:ActivityRewardSingleShow(i,missionInfo[i])
|
|
end
|
|
if isFirstOpen then
|
|
isFirstOpen = false
|
|
self.findTreasureGridGo:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0)
|
|
end
|
|
self:RemainTimeDown()
|
|
|
|
--vip
|
|
local curVipState = 1
|
|
local curVipStateId = 1
|
|
local FindTreasureGaoIdNum = PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.GoFindTreasure)--高级寻宝
|
|
local FindTreasureHaoIdNum = PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.HaoFindTreasure)--豪华寻宝
|
|
if FindTreasureGaoIdNum then
|
|
curVipStateId = FindTreasureManager.FindTreasureGaoId
|
|
curVipState = 2
|
|
end
|
|
if FindTreasureHaoIdNum then
|
|
curVipStateId = FindTreasureManager.FindTreasureHaoId
|
|
curVipState = 3
|
|
end
|
|
self.FindTreasureVipEffect:SetActive(curVipState > 1)
|
|
--self.FindTreasureVipText.text = RefreshItemNum
|
|
self.FindTreasureVipIcon.sprite = Util.LoadSprite(FindTreasureVipTypeSprite[curVipState])
|
|
self.FindTreasureVipTextIcon.sprite = Util.LoadSprite(FindTreasureVipTextTypeSprite[curVipState])
|
|
--刷新道具
|
|
local mazeTreasureSetting = ConfigManager.GetConfigData(ConfigName.MazeTreasureSetting,1)--得判断是否 特权
|
|
local itemNum = BagManager.GetItemCountById(FindTreasureManager.refreshTicketItemId)
|
|
local RefreshItemNum = BagManager.GetItemCountById(mazeTreasureSetting.RefreshItem[1])
|
|
--Log("83 itemNum "..itemNum)
|
|
--Log("79 RefreshItemNum "..RefreshItemNum)
|
|
self.refreshBtnText:SetActive(itemNum > 0)
|
|
self.refreshImageGo:SetActive(itemNum <= 0)
|
|
if itemNum <= 0 then
|
|
if RefreshItemNum > 0 then--劵有时花卷 没时候花妖晶
|
|
self.refreshBtnNumText.text = mazeTreasureSetting.RefreshItem[2]
|
|
--Log("---------------mazeTreasureSetting.RefreshItem[1] "..mazeTreasureSetting.RefreshItem[1])
|
|
self.refreshBtnImage.sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,mazeTreasureSetting.RefreshItem[1]).ResourceID))
|
|
else
|
|
local refreshNum = PlayerManager.missingRefreshCount
|
|
local cost = mazeTreasureSetting.Cost[2]
|
|
local costNum = math.floor(((cost[1] * math.pow(refreshNum, 3) + cost[2] * math.pow(refreshNum, 2) + cost[3] * refreshNum + cost[4])))
|
|
self.refreshBtnNumText.text = costNum
|
|
--Log("---------------mazeTreasureSetting.RefreshItem[1] "..mazeTreasureSetting.RefreshItem[1])
|
|
self.refreshBtnImage.sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,mazeTreasureSetting.Cost[1][1]).ResourceID))
|
|
isRefreshAddNum = true
|
|
if BagManager.GetItemCountById(mazeTreasureSetting.Cost[1][1]) < costNum then
|
|
refreshIsMaterial = false
|
|
end
|
|
end
|
|
end
|
|
local mazeTreasureMax = ConfigManager.GetConfigData(ConfigName.PlayerLevelConfig,PlayerManager.level).MazeTreasureMax
|
|
local bagNum = BagManager.GetItemCountById(FindTreasureManager.materialItemId)
|
|
if bagNum >= mazeTreasureMax then
|
|
self.materialImageNumText.text = "<color=#FFD700>"..PrintWanNum3(bagNum).."</color>/"..mazeTreasureMax
|
|
else
|
|
self.materialImageNumText.text ="<color=#FCF5D3>"..PrintWanNum3(bagNum).."</color>/"..mazeTreasureMax
|
|
end
|
|
|
|
self.materialImage.sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,FindTreasureManager.materialItemId).ResourceID))
|
|
|
|
self.refreshNumText.text = RefreshItemNum
|
|
self.refreshImage.sprite=Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,mazeTreasureSetting.RefreshItem[1]).ResourceID))
|
|
|
|
local gaoState = PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.GoFindTreasure)
|
|
local haoState = PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.HaoFindTreasure)
|
|
if gaoState and haoState then
|
|
FindTreasureManager.SetShowFindTreasureVipRedPoint(false)
|
|
end
|
|
self.findTreasureVipBtnRedPoint:SetActive(FindTreasureManager.GetShowFindTreasureVipRedPoint())
|
|
end
|
|
|
|
--活动奖励2
|
|
function FindTreasureMainPanel:ActivityRewardSingleShow(index,rewardData)
|
|
local activityRewardGo = findTreasureGrid[index]
|
|
activityRewardGo:SetActive(true)
|
|
local sConFigData = ConfigManager.GetConfigData(ConfigName.MazeTreasure,math.floor(rewardData.missionId%10000))
|
|
local titleText = Util.GetGameObject(activityRewardGo, "titleImage/titleText"):GetComponent("Text")
|
|
local titleImage = Util.GetGameObject(activityRewardGo, "titleImage"):GetComponent("Image")
|
|
titleText.text = sConFigData.Desc.." 【"..FindTreasureMissionTitleTypeStr[sConFigData.TaskType].."】"
|
|
titleImage.sprite = Util.LoadSprite(FindTreasureMissionTitleTypeSprite[sConFigData.TaskType])
|
|
local content = Util.GetGameObject(activityRewardGo, "content")
|
|
|
|
--星星数量
|
|
for n = 1, 6 do
|
|
Util.GetGameObject(activityRewardGo,"star/Image"..n):GetComponent("Image").sprite=Util.LoadSprite(starImage[1])
|
|
end
|
|
for m = 1, tonumber(sConFigData.TaskType) do
|
|
Util.GetGameObject(activityRewardGo,"star/Image"..m):GetComponent("Image").sprite=Util.LoadSprite(starImage[2])
|
|
end
|
|
|
|
for i = 1, math.max(#sConFigData.Reward, #findTreasureItemsGrid[index]) do
|
|
local go = findTreasureItemsGrid[index][i]
|
|
if not go then
|
|
go = SubUIManager.Open(SubUIConfig.ItemView, content.transform)
|
|
findTreasureItemsGrid[index][i] = go
|
|
end
|
|
go.gameObject:SetActive(false)
|
|
end
|
|
for i = 1, #sConFigData.Reward do
|
|
findTreasureItemsGrid[index][i].gameObject:SetActive(true)
|
|
findTreasureItemsGrid[index][i]:OnOpen(false,sConFigData.Reward[i],0.77,false,false,false,self.sortingOrder)
|
|
end
|
|
local grtButton = Util.GetGameObject(activityRewardGo.gameObject, "grtButton")
|
|
local jumpButton = Util.GetGameObject(activityRewardGo.gameObject, "jumpButton")
|
|
local quickGetButton = Util.GetGameObject(activityRewardGo.gameObject, "quickGetButton")
|
|
local quickGetButtonImage = Util.GetGameObject(activityRewardGo.gameObject, "quickGetButton/Image"):GetComponent("Image")
|
|
local quickGetButtonNumText = Util.GetGameObject(activityRewardGo.gameObject, "quickGetButton/numText"):GetComponent("Text")
|
|
local getFinishText = Util.GetGameObject(activityRewardGo.gameObject, "getFinishText")
|
|
local consumeObj = Util.GetGameObject(activityRewardGo.gameObject, "consumeObj")
|
|
local consumeObjImage = Util.GetGameObject(activityRewardGo.gameObject, "consumeObj/Image"):GetComponent("Image")
|
|
local consumeObjNumText = Util.GetGameObject(activityRewardGo.gameObject, "consumeObj/numText"):GetComponent("Text")
|
|
local timeTextGo = Util.GetGameObject(activityRewardGo.gameObject, "timeObject")
|
|
--Log("rewardData "..rewardData.missionId.." "..rewardData.state.." "..sConFigData.Desc)
|
|
timeTextGo:SetActive(rewardData.state == 0 and rewardData.heroId and #rewardData.heroId > 0 )
|
|
grtButton:SetActive(rewardData.state == 1)
|
|
jumpButton:SetActive(rewardData.state == 0 and rewardData.heroId and #rewardData.heroId <= 0)
|
|
getFinishText:SetActive(rewardData.state == 2)
|
|
consumeObj:SetActive(rewardData.state == 0 and rewardData.heroId and #rewardData.heroId <= 0)
|
|
quickGetButton:SetActive(rewardData.state == 0 and rewardData.heroId and #rewardData.heroId > 0 )
|
|
consumeObjImage.sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,sConFigData.TakeItem[1]).ResourceID))
|
|
consumeObjNumText.text = sConFigData.TakeItem[2]
|
|
quickGetButtonImage.sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,sConFigData.SpeedUpTake[1]).ResourceID))
|
|
quickGetButtonNumText.text = sConFigData.SpeedUpTake[2]
|
|
Util.AddOnceClick(jumpButton, function()
|
|
UIManager.OpenPanel(UIName.FindTreasureDispatchPanel,rewardData)
|
|
end)
|
|
Util.AddOnceClick(grtButton, function()
|
|
NetManager.TakeMissionRewardRequest(TaskTypeDef.FindTreasure,rewardData.missionId, function(msg)
|
|
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
|
end)
|
|
TaskManager.RefreshFindTreasureStatrData(rewardData.missionId,2)
|
|
self:OnShowPanelData(true)
|
|
--刷新界面
|
|
end)
|
|
end)
|
|
Util.AddOnceClick(quickGetButton, function()
|
|
NetManager.FindTreasureMissingRoomAccelerateRequest(rewardData.missionId, function()
|
|
--刷新界面
|
|
TaskManager.RefreshFindTreasureStatrData(rewardData.missionId,1)
|
|
self:OnShowPanelData(false)
|
|
end)
|
|
end)
|
|
end
|
|
--刷新倒计时显示
|
|
function FindTreasureMainPanel:RemainTimeDown()
|
|
if timer then
|
|
timer:Stop()
|
|
timer = nil
|
|
end
|
|
self:RemainTimeDown2()
|
|
timer = Timer.New(function()
|
|
self:RemainTimeDown2()
|
|
end, 1, -1, true)
|
|
timer:Start()
|
|
end
|
|
function FindTreasureMainPanel:RemainTimeDown2()
|
|
for i = 1, #missionInfo do
|
|
if missionInfo[i].state == 0 and #missionInfo[i].heroId > 0 then--未完成 已派遣
|
|
local timeTextGo = Util.GetGameObject(findTreasureGrid[i], "timeObject/timeText")
|
|
local timeDown = missionInfo[i].progress - GetTimeStamp()
|
|
if timeDown > 0 then
|
|
timeTextGo:SetActive(true)
|
|
local cursConFigData = ConfigManager.GetConfigData(ConfigName.MazeTreasure,math.floor(missionInfo[i].missionId%10000))
|
|
local timeText = Util.GetGameObject(findTreasureGrid[i], "timeObject/timeText"):GetComponent("Text")
|
|
local timeExp = Util.GetGameObject(findTreasureGrid[i], "timeObject/exp"):GetComponent("Slider")
|
|
timeExp.value = (1- (timeDown / cursConFigData.WasteTime ))
|
|
timeText.text = self:TimeStampToDateString(timeDown)
|
|
else
|
|
missionInfo[i].state = 1
|
|
timeTextGo:SetActive(false)
|
|
self:ActivityRewardSingleShow(i,missionInfo[i])
|
|
end
|
|
end
|
|
end
|
|
end
|
|
function FindTreasureMainPanel:TimeStampToDateString(second)
|
|
local day = math.floor(second / (24 * 3600))
|
|
local minute = math.floor(second / 60) % 60
|
|
local sec = second % 60
|
|
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
|
return string.format("%02d:%02d:%02d", hour, minute, sec)
|
|
end
|
|
local sortTable={
|
|
[0] = 0,
|
|
[1] = -1,
|
|
[2] = 2,
|
|
}
|
|
function FindTreasureMainPanel:MissionInfoSort(missionInfo)
|
|
table.sort(missionInfo, function(a, b)
|
|
if a.state == b.state then
|
|
if #a.heroId > 0 and #b.heroId > 0 or #a.heroId <= 0 and #b.heroId <= 0 then
|
|
return ConfigManager.GetConfigData(ConfigName.MazeTreasure,math.floor(a.missionId%10000)).TaskType >
|
|
ConfigManager.GetConfigData(ConfigName.MazeTreasure,math.floor(b.missionId%10000)).TaskType
|
|
else
|
|
return #a.heroId < #b.heroId
|
|
end
|
|
else
|
|
return sortTable[a.state] < sortTable[b.state]
|
|
end
|
|
end)
|
|
end
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
function FindTreasureMainPanel:OnClose()
|
|
|
|
if timer then
|
|
timer:Stop()
|
|
timer = nil
|
|
end
|
|
refreshIsMaterial = true
|
|
isRefreshAddNum = false
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.CloseUI.OnClose)
|
|
end
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
function FindTreasureMainPanel:OnDestroy()
|
|
|
|
findTreasureGrid = {}
|
|
findTreasureItemsGrid = {}
|
|
missionInfo = {}
|
|
refreshIsMaterial = true
|
|
isRefreshAddNum = false
|
|
end
|
|
|
|
return FindTreasureMainPanel |