dev_chengFeng
wangzhenxing 2021-09-09 23:01:23 +08:00
parent 159f2e2494
commit 3257b89e70
7 changed files with 89 additions and 28 deletions

View File

@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 223004754372590400} - component: {fileID: 223004754372590400}
- component: {fileID: 114372824615027968} - component: {fileID: 114372824615027968}
m_Layer: 0 m_Layer: 0
m_Name: ArenaRecordPopup m_Name: WorldArenaRecordPopup
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -345,7 +345,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 194.01, y: -2.9} m_AnchoredPosition: {x: 350.1, y: 43.2}
m_SizeDelta: {x: 130.79, y: 50} m_SizeDelta: {x: 130.79, y: 50}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &222929285231308004 --- !u!222 &222929285231308004
@ -383,13 +383,13 @@ MonoBehaviour:
m_BestFit: 1 m_BestFit: 1
m_MinSize: 26 m_MinSize: 26
m_MaxSize: 34 m_MaxSize: 34
m_Alignment: 5 m_Alignment: 3
m_AlignByGeometry: 0 m_AlignByGeometry: 0
m_RichText: 1 m_RichText: 1
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: +15 m_Text: "\u79EF\u5206+15"
--- !u!1 &1302819781731396 --- !u!1 &1302819781731396
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1087,7 +1087,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &224170130709635840 --- !u!224 &224170130709635840
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -232,6 +232,10 @@ function WorldArenaBattleInfoPanel:BindEvent()
this.btnText.text="确定" this.btnText.text="确定"
end end
end) end)
--添加奖励 --
if msg.drop then
WorldArenaManager.AddReward(msg.drop)
end
-- for i = 1, #this.playBacks do -- for i = 1, #this.playBacks do
-- this.playBacks[i]:SetActive(true) -- this.playBacks[i]:SetActive(true)
-- end -- end
@ -345,7 +349,9 @@ function WorldArenaBattleInfoPanel:OnOpen(msg,_type,closeFunc,list)
if list then if list then
state=3 state=3
resultList=list resultList=list
for i = 1, 3 do for i = 1, 3 do
this.playBacks[i]:SetActive(true)
this.ShowBattleState(i,3) this.ShowBattleState(i,3)
end end
end end
@ -355,6 +361,9 @@ function this.ShowInfo(msg)
--我的信息 --我的信息
myInfoData=msg.myTeamInfo myInfoData=msg.myTeamInfo
enInfoData=msg.defTeamInfo enInfoData=msg.defTeamInfo
if msg.fightData then
fightDataList=msg.fightData
end
this.myName.text= PracticeManager.SetNameColor(JingJiShouWeiToEn(PlayerManager.nickName),msg.myTeamInfo.practiceLevel) this.myName.text= PracticeManager.SetNameColor(JingJiShouWeiToEn(PlayerManager.nickName),msg.myTeamInfo.practiceLevel)
this.myServer.text= PracticeManager.SetNameColor(PlayerManager.serverInfo.name,1) this.myServer.text= PracticeManager.SetNameColor(PlayerManager.serverInfo.name,1)
this.myRankImg.sprite=this.spLoader:LoadSprite("y_yuxulundao_xiaobiao_0"..1) this.myRankImg.sprite=this.spLoader:LoadSprite("y_yuxulundao_xiaobiao_0"..1)

View File

@ -175,6 +175,7 @@ function WorldArenaMainPanel:OnOpen(...)
local args = {...} local args = {...}
NetManager.CrossYuXuLunDaoGetInfoRequest(function(msg) NetManager.CrossYuXuLunDaoGetInfoRequest(function(msg)
local currRankId=msg.newLevelId local currRankId=msg.newLevelId
LogError(" newMyscore=="..msg.newMyscore)
grid, rankData=WorldArenaManager.GetRankImgByScore(msg.newMyscore) grid, rankData=WorldArenaManager.GetRankImgByScore(msg.newMyscore)
--rankData=ConfigManager.GetConfigData(ConfigName.MServerRankConfig,currRankId) --rankData=ConfigManager.GetConfigData(ConfigName.MServerRankConfig,currRankId)
battleTimes=msg.changedTimes battleTimes=msg.changedTimes
@ -327,11 +328,14 @@ function this:RefreshEnemyData(team)
SecTorPlayAnim(prefab) SecTorPlayAnim(prefab)
end end
function WorldArenaMainPanel:OnFocus()
LogError("************//////")
end
-- 打开,重新打开时回调 -- 打开,重新打开时回调
function WorldArenaMainPanel:OnShow() function WorldArenaMainPanel:OnShow()
SoundManager.PlayMusic(SoundConfig.BGM_Arena) SoundManager.PlayMusic(SoundConfig.BGM_Arena)
LogError("**********")
end end
function WorldArenaMainPanel:OnSortingOrderChange() function WorldArenaMainPanel:OnSortingOrderChange()

View File

@ -3,14 +3,55 @@ local this = WorldArenaManager
local ArenaSetting = ConfigManager.GetConfig(ConfigName.MServerArenaSetting) local ArenaSetting = ConfigManager.GetConfig(ConfigName.MServerArenaSetting)
local rankConfig = ConfigManager.GetConfig(ConfigName.MServerRankConfig) local rankConfig = ConfigManager.GetConfig(ConfigName.MServerRankConfig)
local oldScore=0
local newScore=0
local freeTimes
local myRankId=0
local challengeTime=0
local rewardList={}
function this.Initialize() function this.Initialize()
this.rank=0 rewardList={}
this.star=0
end end
local freeTimes
--添加奖励
function this.AddReward(drop)
if drop.itemlist then
for i = 1, #drop do
for j = 1, #drop[i].itemlist do
local item={}
item.itemId=drop[i].itemlist[j].itemId
item.itemNum=drop[i].itemlist[j].itemNum
table.insert(rewardList,item)
end
end
end
end
function this.SetMyData(rank,free,time)
myRankId=rank
freeTimes=free
challengeTime=time
end
function this.SetOldScore(num)
oldScore=num
end
function this.GetOldScore()
return oldScore
end
function this.SetNewScore(num)
newScore=num
end
function this.GetNewScore()
return newScore
end
function this.SetFreeTime(num) function this.SetFreeTime(num)
freeTimes=num freeTimes=num
end end
@ -42,7 +83,7 @@ function this.GetRankImgByScore(num)
return v.RankGrade+1,v return v.RankGrade+1,v
end end
end end
return 1 return 1,rankConfig[1]
end end
local _StarShow = { local _StarShow = {

View File

@ -6,6 +6,7 @@ local type=0 --1:挑战 2详情
local itemId, needNum local itemId, needNum
local haveNum=0 local haveNum=0
local time=0 local time=0
local enemyId
function WorldArenaOtherTeamPanel:InitComponent() function WorldArenaOtherTeamPanel:InitComponent()
self.spLoader = SpriteLoader.New() self.spLoader = SpriteLoader.New()
self.btnBack = Util.GetGameObject(self.gameObject, "Frame/BackBtn") self.btnBack = Util.GetGameObject(self.gameObject, "Frame/BackBtn")
@ -62,6 +63,12 @@ function WorldArenaOtherTeamPanel:BindEvent()
PopupTipPanel.ShowTip("邀请函不足!") PopupTipPanel.ShowTip("邀请函不足!")
return return
end end
NetManager.CrossYuXuLunDaoChallengeBeforeRequest(PlayerManager.uid,self.playerId,function(msg)
LogError("open battleinfo ???")
UIManager.OpenPanel(UIName.WorldArenaBattleInfoPanel,msg,1, function()
--self:RefreshChallengeList()
end)
end)
--显示挑战界面 --显示挑战界面
self:ClosePanel() self:ClosePanel()
end) end)

View File

@ -201,8 +201,8 @@ function this.RankNodeAdapter(node, data)
end end
windData.myTeamInfo=myTeamInfo windData.myTeamInfo=myTeamInfo
windData.defTeamInfo=enTeamInfo windData.defTeamInfo=enTeamInfo
windData.fightData=fightDataList
UIManager.OpenPanel(UIName.WorldArenaBattleInfoPanel,windData,2,data.resultList) UIManager.OpenPanel(UIName.WorldArenaBattleInfoPanel,windData,2,nil,data.resultList)
end) end)
end end

View File

@ -3,14 +3,15 @@ WorldArenaUpRewardPanel = Inherit(BasePanel)
local this = WorldArenaUpRewardPanel local this = WorldArenaUpRewardPanel
local RankConfig=ConfigManager.GetConfig(ConfigName.MServerRankConfig) local RankConfig=ConfigManager.GetConfig(ConfigName.MServerRankConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local lastRankId=10 local lastRankId=0
local currRankId=12 local currRankId=0
local lastScore=180 local lastScore=0
local currScore=212 local currScore=0
local rankData local rankData
local maxScore local maxScore
local minScore local minScore
local layer local layer
local aaa
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function WorldArenaUpRewardPanel:InitComponent() function WorldArenaUpRewardPanel:InitComponent()
this.spLoader = SpriteLoader.New() this.spLoader = SpriteLoader.New()
@ -50,7 +51,12 @@ function WorldArenaUpRewardPanel:OnOpen(...)
else else
this.titleObj.gameObject:SetActive(false) this.titleObj.gameObject:SetActive(false)
end end
rankData=RankConfig[lastRankId] lastScore=PlayerPrefs.GetInt(PlayerManager.uid.."yuxulundaoScore")
aaa, rankData=WorldArenaManager.GetRankImgByScore(lastScore)
lastRankId=rankData.Id
local grade, newRankData=WorldArenaManager.GetRankImgByScore(currScore)
currRankId=newRankData.Id
--rankData=RankConfig[lastRankId]
minScore=rankData.ScoreLow minScore=rankData.ScoreLow
maxScore=rankData.ScoreUp maxScore=rankData.ScoreUp
currRank= rankData.RankGrade+1 currRank= rankData.RankGrade+1
@ -72,12 +78,7 @@ function WorldArenaUpRewardPanel:OnOpen(...)
local itemRandomDataList={} local itemRandomDataList={}
local aaa={} local aaa={}
aaa.itemlist={} aaa.itemlist={}
for i = 1, 10 do aaa.itemlist=WorldArenaManager.rewardList
local item={}
item.itemId=16
item.itemNum=100
table.insert(aaa.itemlist,item)
end
itemRandomDataList=BagManager.GetTableByBackDropData(aaa) itemRandomDataList=BagManager.GetTableByBackDropData(aaa)
local baseContentList2={} local baseContentList2={}
this.SetItemShow(aaa,itemRandomDataList,this.grid.transform,callList2,baseContentList2) this.SetItemShow(aaa,itemRandomDataList,this.grid.transform,callList2,baseContentList2)
@ -89,7 +90,6 @@ end
function this.SetStarShow(star,grade,layer) function this.SetStarShow(star,grade,layer)
-- 设置星级 -- 设置星级
WorldArenaManager.SetStarShow(this.starList, rankData.RankLevel) WorldArenaManager.SetStarShow(this.starList, rankData.RankLevel)
if currRank~=grade then if currRank~=grade then
if titleLive then if titleLive then
destroy(titleLive) destroy(titleLive)
@ -170,9 +170,7 @@ function this.StartProgressChange(func)
if this.TimeCounter then if this.TimeCounter then
this.TimeCounter=nil this.TimeCounter=nil
end end
if lastRankId>currRankId then
num=lastRankId-currRankId
end
local function _TimeUpdate() local function _TimeUpdate()
--降低 --降低
if lastScore<currScore then if lastScore<currScore then
@ -223,6 +221,8 @@ function this.OnClose()
if this.TimeCounter then if this.TimeCounter then
this.TimeCounter:Stop() this.TimeCounter:Stop()
this.TimeCounter = nil this.TimeCounter = nil
WorldArenaManager.rewardList={}
PlayerPrefs.SetInt(PlayerManager.uid.."yuxulundaoScore",currScore)
end end
end end