miduo_client/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua

481 lines
19 KiB
Lua
Raw Normal View History

require("Base/BasePanel")
local WorldArenaMainPanel = Inherit(BasePanel)
local this = WorldArenaMainPanel
local arenaBattleReward = ConfigManager.GetConfig(ConfigName.ArenaBattleReward)
2021-09-07 17:05:46 +08:00
local MServerRankConfig=ConfigManager.GetConfig(ConfigName.MServerRankConfig)
local rewardBoxBtn
2021-09-07 17:05:46 +08:00
local titleLive
local myRank=0
2021-09-09 11:48:09 +08:00
local leftTimes=0
local battleTimes=0
2021-09-10 15:50:24 +08:00
local challengeTime=0
2021-09-09 11:48:09 +08:00
local rewardState=nil
local enemyList={}
2021-09-10 15:50:24 +08:00
local freeTimes=0
--初始化组件(用于子类重写)
function WorldArenaMainPanel:InitComponent()
this.spLoader = SpriteLoader.New()
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
this.ArenaName = Util.GetGameObject(self.gameObject, "nameImg/name")
this.ArenaTime = Util.GetGameObject(self.gameObject, "timelab")
2021-09-07 17:05:46 +08:00
this.Integral = Util.GetGameObject(self.gameObject, "myScore/integral"):GetComponent("Text")
this.endTime = Util.GetGameObject(self.gameObject, "myScore/Text"):GetComponent("Text")
this.rankPar= Util.GetGameObject(self.gameObject, "center/ranks")
this.rankName= Util.GetGameObject(self.gameObject, "center/Text"):GetComponent("Text")
this.StarList={}
for i = 1, 5 do
table.insert(this.StarList, Util.GetGameObject(self.gameObject, "starPar/Image"..i))
end
this.Enemys = {}
2021-09-07 17:05:46 +08:00
for i = 1, 5 do
table.insert(this.Enemys, Util.GetGameObject(self.gameObject, "challengebox/enemy_"..i))
end
--右侧按钮
this.RecordBtn = Util.GetGameObject(self.gameObject, "rightUp/record")
this.RefreshBtn = Util.GetGameObject(self.gameObject, "refresh")
this.RewardBtn = Util.GetGameObject(self.gameObject, "rightUp/reward")
this.StoreBtn = Util.GetGameObject(self.gameObject, "rightUp/store")
this.sortBtn = Util.GetGameObject(self.gameObject, "rightUp/sortBtn")
this.helpBtn = Util.GetGameObject(self.gameObject, "rightUp/helpBtn")
this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
this.FormationBtn = Util.GetGameObject(self.gameObject, "rightUp/formationBtn")
--this.rank=Util.GetGameObject(this.myRank,"Rank"):GetComponent("Text")
this.power=Util.GetGameObject(self.gameObject,"powerImg/Power"):GetComponent("Text")
--宝箱部分
this.progressImage = Util.GetGameObject(self.gameObject, "finalTarget/progressbar/progress"):GetComponent("Image")
this.progressTipText = Util.GetGameObject(self.gameObject, "finalTarget/Text (1)"):GetComponent("Text")
rewardBoxBtn = {}
2021-09-07 17:05:46 +08:00
this.freeTimes = Util.GetGameObject(self.gameObject, "count/text"):GetComponent("Text")
for i = 1, 5 do
rewardBoxBtn[i] = Util.GetGameObject(self.gameObject, "finalTarget/rewardProgress/rewardBoxBtn (" .. i .. ")")
2021-09-07 17:05:46 +08:00
--rewardBoxBtn[i].transform.localPosition = Vector3.New(arenaBattleReward[i].Position[1], arenaBattleReward[i].Position[2] ,0)
end
2021-09-07 17:05:46 +08:00
-- 上部货币显示
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform, { showType = UpViewOpenType.ShowLeft})
2021-09-10 15:50:24 +08:00
this.OpenView()
end
--绑定事件(用于子类重写)
function WorldArenaMainPanel:BindEvent()
Util.AddClick(this.btnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel()
end)
-- 防守编队
Util.AddClick(this.FormationBtn, function()
2021-09-07 17:05:46 +08:00
-- if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ARENA) then
-- PopupTipPanel.ShowTip(Language[10075])
-- return
-- end
2021-09-09 11:48:09 +08:00
UIManager.OpenPanel(UIName.WorldArenaMyTeamPanel,1)
end)
-- 挑战按钮
for i, enemy in ipairs(this.Enemys) do
local challengeBtn = Util.GetGameObject(enemy, "challenge")
Util.AddClick(challengeBtn, function()
2021-09-28 15:50:09 +08:00
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_YuXu) then
PopupTipPanel.ShowTip(Language[10075])
return
end
-- 只在活动时间范围内可点
2021-09-11 15:05:37 +08:00
-- if ArenaManager.GetLeftTime() > 0 then
-- 添加次数限制
2021-09-18 10:38:57 +08:00
leftTimes = PrivilegeManager.GetPrivilegeRemainValue(0)
if leftTimes <= 0 then
2021-09-07 17:05:46 +08:00
local itemId, needNum = WorldArenaManager.GetArenaChallengeCost()
local haveNum = BagManager.GetItemCountById(itemId)
if haveNum < needNum then
2021-09-18 10:38:57 +08:00
UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.ChallengeTicket })
PopupTipPanel.ShowTip("挑战券不足!")
return
end
end
2021-09-09 11:48:09 +08:00
NetManager.CrossYuXuLunDaoChallengeBeforeRequest(PlayerManager.uid,enemyList[i],function(msg)
UIManager.OpenPanel(UIName.WorldArenaBattleInfoPanel,msg,1, function()
self:RefreshChallengeList()
end)
2021-09-09 11:48:09 +08:00
end)
2021-09-11 15:05:37 +08:00
-- else
-- PopupTipPanel.ShowTip(Language[10092])
-- end
end)
end
--排行
Util.AddClick(this.sortBtn, function()
2021-09-24 11:09:09 +08:00
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[31])
end)
-- 刷新按钮
2021-09-11 18:53:58 +08:00
this._RefreshTimeStemp=0
Util.AddClick(this.RefreshBtn, function()
2021-09-11 18:53:58 +08:00
local curTimeStemp = GetTimeStamp()
local limitTime = 3
-- 计算距离下一次刷新剩余时间
local lastTime = math.floor(limitTime - (curTimeStemp - this._RefreshTimeStemp))
if this._RefreshTimeStemp ~= 0 and lastTime > 0 then
PopupTipPanel.ShowTip(lastTime..Language[10079])
return
end
this._RefreshTimeStemp = curTimeStemp
self:RefreshChallengeList()
end)
-- 记录按钮
Util.AddClick(this.RecordBtn, function()
2021-09-11 18:53:58 +08:00
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_YuXu) then
PopupTipPanel.ShowTip(Language[10075])
return
end
2021-09-09 16:47:18 +08:00
NetManager.CrossYuXuLunDaoBattleRecordRequest(PlayerManager.uid,function(msg)
UIManager.OpenPanel(UIName.WorldArenaRecordPopup,msg.recordData)
end)
2021-09-11 15:05:37 +08:00
-- ResetServerRedPointStatus(RedPointType.WorldArena_Record)
end)
-- 帮助按钮
Util.AddClick(this.helpBtn, function()
2021-09-09 19:21:50 +08:00
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.YuXu,this.helpPosition.x,this.helpPosition.y)
end)
-- 奖励按钮
Util.AddClick(this.RewardBtn, function()
2021-10-15 15:47:55 +08:00
UIManager.OpenPanel(UIName.WorldArenaRankRewardPanel,WorldArenaManager.GetMyRank())
end)
--商店按钮
Util.AddClick(this.StoreBtn, function()
2021-09-09 15:16:41 +08:00
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_YuXu) then
PopupTipPanel.ShowTip(Language[10075])
return
end
2021-09-09 15:16:41 +08:00
JumpManager.GoJump(40032)
end)
2021-09-09 11:48:09 +08:00
2021-09-07 17:05:46 +08:00
end
-- 刷新挑战列表
function WorldArenaMainPanel:RefreshChallengeList()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_YuXu) then
PopupTipPanel.ShowTip(Language[10075])
return
end
NetManager.CrossYuXuLunDaoChangeEnemyInfoRequest(function(msg)
PlaySoundWithoutClick("UI_refresh")
this:RefreshEnemyData(msg.arenaEnemys)
end)
end
--添加事件监听(用于子类重写)
function WorldArenaMainPanel:AddListener()
2021-09-11 15:05:37 +08:00
--BindRedPointObject(RedPointType.WorldArena_Record, Util.GetGameObject(self.gameObject, "record/redpot"))
end
--移除事件监听(用于子类重写)
function WorldArenaMainPanel:RemoveListener()
2021-09-11 15:05:37 +08:00
-- ClearRedPointObject(RedPointType.WorldArena_Record)
end
2021-09-09 15:44:19 +08:00
local grid, rankData
2021-09-07 17:05:46 +08:00
--界面打开时调用(用于子类重写)
2021-09-10 15:50:24 +08:00
local oldScore
2021-09-30 15:12:02 +08:00
function WorldArenaMainPanel:OnOpen(msg)
-- 参数保存
2021-09-30 15:12:02 +08:00
-- NetManager.CrossYuXuLunDaoGetInfoRequest(function(msg)
2021-10-15 18:39:46 +08:00
local isReset=false
2021-10-13 19:35:30 +08:00
if msg.isFirst then
2021-10-15 18:39:46 +08:00
isReset=true
2021-10-13 19:35:30 +08:00
FormationManager.RefreshFormationData(this.CheckTeamDamage)
2021-10-18 09:56:38 +08:00
PlayerPrefs.SetInt(PlayerManager.uid.."yuxulundaoScore",msg.oldMyscore)
2021-10-13 19:35:30 +08:00
end
2021-09-07 17:05:46 +08:00
local currRankId=msg.newLevelId
2021-09-09 15:44:19 +08:00
grid, rankData=WorldArenaManager.GetRankImgByScore(msg.newMyscore)
2021-09-10 15:50:24 +08:00
oldScore=msg.oldMyscore
2021-09-11 15:05:37 +08:00
--新赛季本地数据制成0
2021-09-11 18:53:58 +08:00
if msg.drop and #msg.drop>0 then
2021-09-11 15:05:37 +08:00
WorldArenaManager.AddReward(msg.drop)
2021-10-18 09:56:38 +08:00
2021-09-11 15:05:37 +08:00
end
2021-09-11 18:53:58 +08:00
myRank=msg.myRank
2021-09-07 17:05:46 +08:00
rewardState=msg.dailyRewardState
2021-09-10 15:50:24 +08:00
challengeTime=msg.changedTimes
2021-09-18 10:38:57 +08:00
freeTimes=PrivilegeManager.GetPrivilegeRemainValue(0)
2021-09-10 15:50:24 +08:00
WorldArenaManager.SetNewScore(msg.newMyscore)
2021-09-10 18:21:04 +08:00
WorldArenaManager.SetMyData(myRank,challengeTime)
2021-09-07 17:05:46 +08:00
this.Integral.text="积分:"..msg.newMyscore
2021-09-09 16:27:36 +08:00
this.SetStarShow(grid,self.sortingOrder)
2021-09-07 17:05:46 +08:00
this.endTime.text="周日23:30赛季结束"
this:RefreshEnemyData(msg.arenaEnemys)
2021-09-11 18:53:58 +08:00
2021-09-18 10:38:57 +08:00
if freeTimes==0 then
this.freeTimes.gameObject:SetActive(false)
this.freeTimes.transform.parent.gameObject:SetActive(false)
end
2021-09-10 15:50:24 +08:00
this.freeTimes.text = string.format("%s次", math.max(freeTimes, 0))
--检测段位是否发生变化
2021-09-11 18:53:58 +08:00
if msg.updrop and #msg.updrop>0 then
2021-09-10 15:50:24 +08:00
WorldArenaManager.AddReward(msg.updrop)
end
2021-10-15 18:39:46 +08:00
this.CheckIsRankChange(isReset)
2021-10-13 19:35:30 +08:00
2021-09-30 15:12:02 +08:00
-- end)
end
2021-09-07 17:05:46 +08:00
--星级和段位图标显示
function this.SetStarShow(grade,layer)
-- 设置星级
WorldArenaManager.SetStarShow(this.StarList, rankData.RankLevel)
2021-09-10 15:50:24 +08:00
if titleLive then
destroy(titleLive)
titleLive=nil
end
2021-09-07 17:05:46 +08:00
titleLive = poolManager:LoadAsset("fx_duanwei_0"..grade, PoolManager.AssetType.GameObject)
titleLive.transform:SetParent(this.rankPar.transform)
titleLive.transform.localPosition=Vector3.New(0,-600,0)
titleLive.transform.localScale =Vector3.New(1,1,1)
2021-09-28 11:51:20 +08:00
SetParticleSortLayer(titleLive,layer)
2021-09-07 17:05:46 +08:00
this.rankName.text=rankData.RankName
--this.RefreshEnemyData()
this.ShowRewardBoxProgressData()
end
--显示上边积分奖励
function this.ShowRewardBoxProgressData()
-- local baseData = ArenaManager.GetArenaBaseData()
2021-09-10 18:21:04 +08:00
local allNums = WorldArenaManager.GetchallengeTimes()
2021-09-07 17:05:46 +08:00
--宝箱领取状态
local allBoxGetState = rewardState
local maxNum = 0
local config=ConfigManager.GetConfigDataByKey(ConfigName.MServerRankConfig,1)
local rewards=config.DailyReward
for i = 1, #rewards do
if rewards[i][1]>maxNum then
maxNum=rewards[i][1]
end
end
2021-09-14 10:10:57 +08:00
2021-09-07 17:05:46 +08:00
for i = 1, #rewardBoxBtn do
if rewards[i] then
local state = 1--1 未完成 2 未领取 3 已完成allNums >= arenaBattleReward[i].BattleTimes and false
2021-09-14 10:10:57 +08:00
--LogError("allnum=="..allNums.." rewards[i][1]== "..rewards[i][1].." boxstate=="..allBoxGetState[i])
2021-09-07 17:05:46 +08:00
if allNums < rewards[i][1] then
state = 1
2021-09-10 18:21:04 +08:00
elseif allNums >= rewards[i][1] and allBoxGetState[i]~=2 then
2021-09-07 17:05:46 +08:00
state = 2
else
state = 3
end
Util.GetGameObject(rewardBoxBtn[i], "redPoint"):SetActive(state == 2)
Util.GetGameObject(rewardBoxBtn[i], "Text"):GetComponent("Text").text = rewards[i][1]..Language[10048]
Util.GetGameObject(rewardBoxBtn[i], "getFinish"):SetActive(state == 3)
Util.AddOnceClick(rewardBoxBtn[i], function()
if state == 1 then
UIManager.OpenPanel(UIName.BoxRewardShowPopup,{{rewards[i][2], rewards[i][3]}},rewardBoxBtn[i].transform.localPosition.x,-400,rewards[i][1] .. Language[10100])
2021-09-07 17:05:46 +08:00
return
elseif state == 3 then
PopupTipPanel.ShowTip(Language[10101])
return
elseif state == 2 then
2021-09-10 15:50:24 +08:00
NetManager.CrossYuXuLunDaoGetDailyRewardRequest(i, function(msg)
2021-09-10 21:34:45 +08:00
allBoxGetState[i]=2
--this.ShowRewardBoxProgressData()
2021-10-12 20:21:54 +08:00
WorldArenaManager.SetRewardState(i,2)
2021-09-07 17:05:46 +08:00
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function ()
2021-10-12 20:41:57 +08:00
CheckRedPointStatus(RedPointType.WorldArena_reward)
2021-09-07 17:05:46 +08:00
end)
end)
end
end)
end
end
this.progressImage.fillAmount = allNums/maxNum
2021-09-10 21:34:45 +08:00
this.progressTipText.text = "今日挑战"
2021-09-07 17:05:46 +08:00
end
-- 刷新敌人列表
function this:RefreshEnemyData(team)
local prefab = {}
--local leftTimes=time
table.sort(team, function(a,b) return a.score > b.score end)
local EnemyList =team -- ArenaManager.GetEnemyList()
2021-09-09 11:48:09 +08:00
enemyList={}
2021-09-07 17:05:46 +08:00
for i, node in ipairs(this.Enemys) do
node:SetActive(false)
if EnemyList[i] then
table.insert(prefab,node)
local lv_name = Util.GetGameObject(node, "name"):GetComponent("Text")
local integral = Util.GetGameObject(node, "integralTip"):GetComponent("Text")
-- Util.GetGameObject(node, "power"):SetActive(false)
-- Util.GetGameObject(node, "integral"):SetActive(false)
local power = Util.GetGameObject(node, "powerTip")
local headroot = Util.GetGameObject(node, "headroot")
local bg = Util.GetGameObject(node, "bg")
local btnText = Util.GetGameObject(node, "challenge/Text"):GetComponent("Text")
local btnItem = Util.GetGameObject(node, "challenge/item"):GetComponent("Image")
local btnItemNum = Util.GetGameObject(node, "challenge/item/num"):GetComponent("Text")
local rankImg= Util.GetGameObject(node, "rankImg"):GetComponent("Image")
2021-09-07 18:27:23 +08:00
local rankId=WorldArenaManager.GetRankImgByScore(EnemyList[i].score)
rankImg.sprite=this.spLoader:LoadSprite("y_yuxulundao_xiaobiao_0"..rankId)
2021-09-07 17:05:46 +08:00
local name=EnemyList[i].servername.." "..EnemyList[i].name
lv_name.text = PracticeManager.SetNameColor(JingJiShouWeiToEn(name),EnemyList[i].practiceLevel)
integral:GetComponent("Text").text = Language[11693].. EnemyList[i].score
power:GetComponent("Text").text = Language[12179]..EnemyList[i].totalForce
2021-09-10 18:21:04 +08:00
btnText.gameObject:SetActive(freeTimes > 0)
2021-09-07 17:05:46 +08:00
btnText.text = Language[10099]
2021-09-10 18:21:04 +08:00
btnItem.gameObject:SetActive(freeTimes <= 0)
if freeTimes <= 0 then
2021-09-07 17:05:46 +08:00
local itemId, needNum = WorldArenaManager.GetArenaChallengeCost()
local haveNum = BagManager.GetItemCountById(itemId)
btnItem.sprite = SetIcon(this.spLoader, itemId)
btnItemNum.text = "×"..needNum
btnItemNum.color = haveNum < needNum and UIColor.NOT_ENOUGH_RED or UIColor.BTN_TEXT
end
if not this.HeadList then
this.HeadList = {}
end
if not this.HeadList[i] then
this.HeadList[i] = SubUIManager.Open(SubUIConfig.PlayerHeadView, headroot.transform)
end
this.HeadList[i]:Reset()
this.HeadList[i]:SetHead(EnemyList[i].head)
this.HeadList[i]:SetFrame(EnemyList[i].headFrame)
this.HeadList[i]:SetLevel(EnemyList[i].level)
this.HeadList[i]:SetScale(Vector3.one*0.8)
2021-09-28 11:51:20 +08:00
this.HeadList[i]:SetLayer(self.sortingOrder)
2021-09-07 17:05:46 +08:00
this.HeadList[i]:SetEffectScale(0.85)
2021-09-09 11:48:09 +08:00
table.insert(enemyList,EnemyList[i].uid)
2021-09-07 17:05:46 +08:00
Util.AddOnceClick(bg, function()
2021-09-30 15:12:02 +08:00
NetManager.GetPlayerCrossYxldOneTeamInfoRequest(EnemyList[i].uid,0,function(msg)
UIManager.OpenPanel(UIName.WorldArenaOtherTeamPanel, EnemyList[i].uid,1,msg)
end)
2021-09-07 17:05:46 +08:00
end)
end
end
SecTorPlayAnim(prefab)
end
2021-09-09 23:01:23 +08:00
function WorldArenaMainPanel:OnFocus()
2021-09-10 15:50:24 +08:00
local newScore=WorldArenaManager.GetNewScore()
grid,rankData=WorldArenaManager.GetRankImgByScore(newScore)
this.SetStarShow(grid,self.sortingOrder)
this.Integral.text="积分:"..newScore
2021-09-18 10:38:57 +08:00
freeTimes=PrivilegeManager.GetPrivilegeRemainValue(0)
2021-09-10 18:21:04 +08:00
this.freeTimes.text = string.format("%s次", math.max(freeTimes, 0))
2021-09-10 15:50:24 +08:00
this.CheckIsRankChange()
this.ShowRewardBoxProgressData()
2021-09-11 16:00:39 +08:00
for key, value in ipairs(this.Enemys) do
local btnText = Util.GetGameObject(value, "challenge/Text"):GetComponent("Text")
local btnItem = Util.GetGameObject(value, "challenge/item"):GetComponent("Image")
local btnItemNum = Util.GetGameObject(value, "challenge/item/num"):GetComponent("Text")
btnText.gameObject:SetActive(freeTimes > 0)
btnText.text = Language[10099]
btnItem.gameObject:SetActive(freeTimes <= 0)
if freeTimes <= 0 then
local itemId, needNum = WorldArenaManager.GetArenaChallengeCost()
local haveNum = BagManager.GetItemCountById(itemId)
btnItem.sprite = SetIcon(this.spLoader, itemId)
btnItemNum.text = "×"..needNum
btnItemNum.color = haveNum < needNum and UIColor.NOT_ENOUGH_RED or UIColor.BTN_TEXT
end
end
2021-09-10 18:21:04 +08:00
2021-09-09 23:01:23 +08:00
end
2021-09-07 17:05:46 +08:00
2021-09-10 15:50:24 +08:00
function this.CheckIsRankChange(resetData)
local lastScore=PlayerPrefs.GetInt(PlayerManager.uid.."yuxulundaoScore")
local aa,oldData=WorldArenaManager.GetRankImgByScore(lastScore)
--如果有段位变化就显示段位变化界面
2021-09-10 15:50:24 +08:00
if oldData.Id~=rankData.Id then
UIManager.OpenPanel(UIName.WorldArenaUpRewardPanel,resetData)
else--如果没有段位变化就把最新的记录
PlayerPrefs.SetInt(PlayerManager.uid.."yuxulundaoScore",WorldArenaManager.GetNewScore())
2021-09-10 15:50:24 +08:00
end
end
-- 打开,重新打开时回调
function WorldArenaMainPanel:OnShow()
SoundManager.PlayMusic(SoundConfig.BGM_Arena)
2021-10-13 19:35:30 +08:00
this.CheckTeamDamage()
end
function WorldArenaMainPanel.CheckTeamDamage()
2021-09-13 14:11:48 +08:00
local allDamage=0
for i = 2001, 2003 do
allDamage=allDamage+FormationManager.GetFormationPower(i)
end
2021-10-13 19:35:30 +08:00
this.power.text=allDamage
end
2021-10-13 19:35:30 +08:00
2021-09-28 11:51:20 +08:00
function WorldArenaMainPanel:OnSortingOrderChange(order)
--this.sortingOrder=order
if titleLive then
SetParticleSortLayer(titleLive,self.sortingOrder)
end
end
--界面关闭时调用(用于子类重写)
function WorldArenaMainPanel:OnClose()
2021-10-12 20:41:57 +08:00
CheckRedPointStatus(RedPointType.WorldArena_reward)
end
--界面销毁时调用(用于子类重写)
function WorldArenaMainPanel:OnDestroy()
SubUIManager.Close(this.UpView)
2021-09-28 15:50:09 +08:00
if titleLive then
destroy(titleLive)
titleLive=nil
end
-- 清除红点
-- ClearRedPointObject(RedPointType.Arena_Shop)
this.spLoader:Destroy()
if this.shopView then
this.shopView.gameObject:SetActive(true) -- 重置一下显示状态,避免其他界面打开时状态错误
this.shopView = SubUIManager.Close(this.shopView)
this.shopView = nil
end
2021-09-09 11:48:09 +08:00
if this.HeadList then
for i = 1, #this.HeadList do
this.HeadList[i]:Recycle()
this.HeadList[i]=nil
end
end
end
--
2021-09-10 15:50:24 +08:00
function this.OpenView()
-- 货币界面
2021-09-10 15:50:24 +08:00
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.WorldArena })
end
function this.CloseView(index)
if this._CurLogicIndex ~= index then return end
-- 商店界面特殊处理
if index == 3 then
if this.shopView then
this.shopView.gameObject:SetActive(false)
end
return
end
local logic = this.ViewLogicList[index]
if logic then
if logic.RemoveListener then
logic:RemoveListener()
end
if logic.OnClose then
logic:OnClose()
end
logic.gameObject:SetActive(false)
end
end
return WorldArenaMainPanel