【ID1010829】

增加开服竞技比拼活动——竞技试炼
dev_chengFeng
jiaoyangna 2021-12-08 14:03:23 +08:00
parent 9184852070
commit 9b1ca0135c
8 changed files with 3009 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b31d31f5f43a097469b2772dabc937bd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15558,6 +15558,14 @@ MonoBehaviour:
extension: .png
resPathIndex: 18
resAbNameIndex: 9
- resName: kangbaojia
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: kangbaojian
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_Attack_Down
extension: .png
resPathIndex: 19
@ -15650,10 +15658,22 @@ MonoBehaviour:
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_jinjia
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_mofu
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_Up
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_xianyin
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_Nohealing_0001
extension: .png
resPathIndex: 19
@ -17542,6 +17562,14 @@ MonoBehaviour:
extension: .png
resPathIndex: 70
resAbNameIndex: 35
- resName: z_zhandou_kangbaolvjian_zh
extension: .png
resPathIndex: 70
resAbNameIndex: 35
- resName: z_zhandou_kangbaolvjia_zh
extension: .png
resPathIndex: 70
resAbNameIndex: 35
- resName: z_zhandou_leiyun_zh
extension: .png
resPathIndex: 70
@ -27410,6 +27438,10 @@ MonoBehaviour:
extension: .mp3
resPathIndex: 190
resAbNameIndex: 188
- resName: Audio_battle_vo_nmw02
extension: .mp3
resPathIndex: 190
resAbNameIndex: 188
- resName: Audio_battle_vo_nxq01
extension: .mp3
resPathIndex: 190
@ -28662,6 +28694,14 @@ MonoBehaviour:
extension: .mp3
resPathIndex: 193
resAbNameIndex: 489
- resName: Audio_niu_attack_01
extension: .mp3
resPathIndex: 193
resAbNameIndex: 489
- resName: Audio_niu_hit_01
extension: .mp3
resPathIndex: 193
resAbNameIndex: 489
- resName: Audio_normal_effect_01
extension: .mp3
resPathIndex: 193
@ -29222,6 +29262,14 @@ MonoBehaviour:
extension: .mp3
resPathIndex: 198
resAbNameIndex: 611
- resName: Audio_fangcunzhuanpan_0
extension: .mp3
resPathIndex: 199
resAbNameIndex: 611
- resName: Audio_fangcunzhuanpan_1
extension: .mp3
resPathIndex: 199
resAbNameIndex: 611
- resName: Audio_guide_001
extension: .mp3
resPathIndex: 199
@ -58386,6 +58434,10 @@ MonoBehaviour:
extension: .prefab
resPathIndex: 695
resAbNameIndex: 3150
- resName: ArenaTrialPanel
extension: .prefab
resPathIndex: 696
resAbNameIndex: 3151
- resName: FightLevelChapterPanel
extension: .prefab
resPathIndex: 696

View File

@ -1371,6 +1371,7 @@ ActivityTypeDef = {
ContinueGift = 85, -- 连续礼包
ContinuePackage = 87, -- 连购礼包
Incarnation = 86,--抽卡变身卡
jingjishilian = 88,
}
--活动结束需要处理面板关闭类型
ActivityTypePanel = {
@ -1828,6 +1829,7 @@ HELP_TYPE = {
tailsmainSoul = 117,
Incarnation = 118,
LingMaiMiJing = 116,--灵脉秘境
jingjishilian = 122,
}
NumToComplexFont = {

View File

@ -434,6 +434,7 @@ UIName = {
RewardTailsmanChipShowPopup = 440,
ContinueGiftPanel = 441, -- 连续礼包
ContinuePackagePanel = 442, -- 连购礼包new
ArenaTrialPanel = 445,
}
SubUIConfig = {

View File

@ -0,0 +1,195 @@
require("Base/BasePanel")
local ArenaTrialPanel = Inherit(BasePanel)
--初始化组件(用于子类重写)
function ArenaTrialPanel:InitComponent()
self.spLoader = SpriteLoader.New()
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform)
self.btnBack = Util.GetGameObject(self.gameObject,"bg/BackBtn")
self.liveRoot = Util.GetGameObject(self.gameObject,"bg/ren")
self.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn")
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
self.rankingBtn = Util.GetGameObject(self.gameObject, "rankingBtn")
self.title = Util.GetGameObject(self.gameObject,"bg/kuang/zi"):GetComponent("Image")
self.goBtn = Util.GetGameObject(self.gameObject,"bg/kuang/goBtn")
self.goBtnImage = Util.GetGameObject(self.goBtn,"zi"):GetComponent("Image")
self.Rank = Util.GetGameObject(self.goBtn,"di")
self.goNum = Util.GetGameObject(self.Rank,"num"):GetComponent("Text")
self.goTips = Util.GetGameObject(self.goBtn,"tips"):GetComponent("Text")
self.time = Util.GetGameObject(self.gameObject,"bg/kuang/time/Text"):GetComponent("Text")
self.Scroll = Util.GetGameObject(self.gameObject,"bg/kuang/Scroll")
self.leftTime = Util.GetGameObject(self.gameObject,"bg/LeftTime"):GetComponent("Text")
self.itemPre = Util.GetGameObject(self.gameObject,"itemPre")
local rootHight = self.Scroll.transform.rect.height
local width = self.Scroll.transform.rect.width
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.Scroll.transform,
self.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0, 0))
self.ScrollView.moveTween.MomentumAmount = 1
self.ScrollView.moveTween.Strength = 2
self.itemList = {}
self.live = nil
end
--绑定事件(用于子类重写)
function ArenaTrialPanel:BindEvent()
Util.AddClick(self.btnBack, function()
self:ClosePanel()
end)
Util.AddClick(self.goBtn, function()
JumpManager.GoJump(8001)
end)
Util.AddClick(self.helpBtn, function()
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.jingjishilian, self.helpPosition.x,self.helpPosition.y)
end)
Util.AddClick(self.rankingBtn, function()
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[6])
end)
end
--添加事件监听(用于子类重写)
function ArenaTrialPanel:AddListener()
end
--移除事件监听(用于子类重写)
function ArenaTrialPanel:RemoveListener()
end
--界面打开时调用(用于子类重写)
function ArenaTrialPanel:OnOpen()
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function ArenaTrialPanel:OnShow()
self:Refresh(true,true)
end
function ArenaTrialPanel:Refresh(isTop,isAni)
self.actData = CommonActPageManager.GetData(ActivityTypeDef.jingjishilian)
self.title.sprite = self.spLoader:LoadSprite("s_shanheshilian_shanheshilianzi")
self.goBtnImage.sprite = self.spLoader:LoadSprite("s_shanheshilian_anniushangzi")
if self.live then
poolManager:UnLoadLive(self.live.gameObject.name, self.live)
self.live = nil
end
local data = ConfigManager.GetConfigDataByKey(ConfigName.HeroConfig,"ReadingName","敖丙")
self.live = poolManager:LoadLive(GetResourcePath(data.Live), self.liveRoot.transform,
Vector3.one * data.Scale, Vector3.New(data.Position[1], data.Position[2], 0))
local SkeletonGraphic = self.live:GetComponent("SkeletonGraphic")
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
local _, myRankInfo = ArenaManager.GetRankInfo()
local myRank = myRankInfo.personInfo.rank
if myRank < 0 then
myRank = Language[10036]
self.Rank .gameObject:SetActive(false)
self.goTips.text = myRank
else
self.Rank.gameObject:SetActive(true)
self.goNum.text = myRank
self.goTips.text = "第 名"
end
self:SetNumbers()
self:SetRewards(isTop,isAni)
end
function ArenaTrialPanel:SetNumbers()
--设置时间
if self.timer then
self.timer:Stop()
self.timer = nil
end
local time =self.actData.endTime - GetTimeStamp()
self.leftTime.text = string.format(Language[10512].."%s",TimeToFelaxible(time))
self.timer = Timer.New(function ()
time = time - 1
self.leftTime.text = string.format(Language[10512].."%s",TimeToFelaxible(time))
if time <= 0 then
self:ClosePanel()
end
end,1,-1,true)
self.timer:Start()
end
function ArenaTrialPanel:SetRewards(isTop,isAni)
local rewardTabs = {}
for i, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.ActivityRankingReward)) do
if v.ActivityId == self.actData.activityId then
table.insert(rewardTabs,v)
end
end
self.ScrollView:SetData(rewardTabs, function (index, go)
self:SingleDataShow(go, rewardTabs[index],index)
end,not isTop,not isAni)
end
function ArenaTrialPanel:SingleDataShow(item,data,index)
local sortNumTabs = {}
for i = 1, 4 do
sortNumTabs[i] = Util.GetGameObject(item, "SortNum/SortNum ("..i..")")
sortNumTabs[i]:SetActive(false)
end
local sort4Text = Util.GetGameObject(sortNumTabs[4],"TitleText"):GetComponent("Text")
local reward = Util.GetGameObject(item,"reward")
if data.MinRank == data.MaxRank then
if data.MaxRank < 4 then
sortNumTabs[data.MinRank]:SetActive(true)
else
sortNumTabs[4]:SetActive(true)
sort4Text.text = data.MaxRank
end
else
sortNumTabs[4]:SetActive(true)
if data.MaxRank < 0 then
sort4Text.text = data.MinRank .."+"
else
sort4Text.text = data.MinRank .."-".. data.MaxRank
end
end
if not self.itemList[item] then
self.itemList[item] = {}
end
for i = 1, #data.RankingReward do
if not self.itemList[item][i] then
self.itemList[item][i] = SubUIManager.Open(SubUIConfig.ItemView,reward.transform)
end
self.itemList[item][i]:OnOpen(false, data.RankingReward[i], 0.8,false,false,false,self.sortingOrder)
end
end
--界面关闭时调用(用于子类重写)
function ArenaTrialPanel:OnClose()
if self.timer then
self.timer:Stop()
self.timer = nil
end
if self.live then
poolManager:UnLoadLive(self.live.gameObject.name, self.live)
self.live = nil
end
end
--界面销毁时调用(用于子类重写)
function ArenaTrialPanel:OnDestroy()
if self.timer then
self.timer:Stop()
self.timer = nil
end
self.itemList = {}
if self.live then
poolManager:UnLoadLive(self.live.gameObject.name, self.live)
self.live = nil
end
end
return ArenaTrialPanel

View File

@ -1,6 +1,5 @@
fileFormatVersion: 2
guid: 662490c50a0740444ad18e93f84b5061
folderAsset: yes
guid: 80cb96a6503dffd4195efefdb2925ed6
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1066,6 +1066,8 @@ function this:TabBtnAction(id,actType,data)
SwitchPanel.OpenPanel(UIName.YuJianXingPanel,nil,id)
end
end)
elseif id == ActivityTypeDef.jingjishilian then
UIManager.OpenPanel(UIName.ArenaTrialPanel)
end
elseif actType == 2 then
if id == FUNCTION_OPEN_TYPE.SERVER_START_GIFT then