From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/LevelRewardBattleRoyaleHandler.cs | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/LevelRewardBattleRoyaleHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/LevelRewardBattleRoyaleHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/LevelRewardBattleRoyaleHandler.cs b/Client/Assets/Scripts/XMainClient/LevelRewardBattleRoyaleHandler.cs new file mode 100644 index 00000000..0e40f71f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/LevelRewardBattleRoyaleHandler.cs @@ -0,0 +1,94 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class LevelRewardBattleRoyaleHandler : DlgHandlerBase + { + protected override string FileName + { + get + { + return "Battle/LevelReward/LevelRewardBattleRoyaleFrame"; + } + } + + private XLevelRewardDocument doc = null; + + private Transform m_Win; + + private Transform m_Fail; + + private IXUILabel m_Rank; + + private IXUILabel m_Kill; + + private IXUILabel m_KillBy; + + private IXUILabel m_LiveTime; + + private IXUILabel m_Score; + + private IXUILabel m_Tip; + + private IXUIButton m_Button; + + protected override void Init() + { + base.Init(); + this.doc = XDocuments.GetSpecificDocument(XLevelRewardDocument.uuID); + this.InitUI(); + } + + private void InitUI() + { + this.m_Win = base.PanelObject.transform.Find("Bg/Result/Win"); + this.m_Fail = base.PanelObject.transform.Find("Bg/Result/Fail"); + this.m_Rank = (base.PanelObject.transform.Find("Bg/Detail/Rank").GetComponent("XUILabel") as IXUILabel); + this.m_Kill = (base.PanelObject.transform.Find("Bg/Detail/Kill").GetComponent("XUILabel") as IXUILabel); + this.m_KillBy = (base.PanelObject.transform.Find("Bg/Detail/KillBy").GetComponent("XUILabel") as IXUILabel); + this.m_LiveTime = (base.PanelObject.transform.Find("Bg/Detail/JS/Time").GetComponent("XUILabel") as IXUILabel); + this.m_Score = (base.PanelObject.transform.Find("Bg/Detail/JS/Score").GetComponent("XUILabel") as IXUILabel); + this.m_Tip = (base.PanelObject.transform.Find("Bg/Detail/Tip").GetComponent("XUILabel") as IXUILabel); + this.m_Button = (base.PanelObject.transform.Find("Bg/Button/Back").GetComponent("XUIButton") as IXUIButton); + this.m_Button.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnButtonClicked)); + } + + private bool OnButtonClicked(IXUIButton button) + { + this.doc.SendLeaveScene(); + return true; + } + + protected override void OnShow() + { + base.OnShow(); + this.ShowUI(); + } + + private void ShowUI() + { + this.m_Win.gameObject.SetActive(this.doc.BattleRoyaleDataInfo.SelfRank == 1u); + this.m_Fail.gameObject.SetActive(this.doc.BattleRoyaleDataInfo.SelfRank != 1u); + this.m_Rank.SetText(XStringDefineProxy.GetString("BattleRoyaleRank", new object[] + { + this.doc.BattleRoyaleDataInfo.SelfRank, + this.doc.BattleRoyaleDataInfo.AllRank + })); + this.m_Kill.SetText(XStringDefineProxy.GetString("BattleRoyaleKill", new object[] + { + this.doc.BattleRoyaleDataInfo.KillCount + })); + this.m_KillBy.SetText((this.doc.BattleRoyaleDataInfo.SelfRank != 1u) ? XStringDefineProxy.GetString("BattleRoyaleKilledBy", new object[] + { + this.doc.BattleRoyaleDataInfo.KilledBy + }) : ""); + this.m_LiveTime.SetText(XSingleton.singleton.TimeFormatString(this.doc.BattleRoyaleDataInfo.LiveTime, 2, 3, 4, false)); + this.m_Score.SetText(this.doc.BattleRoyaleDataInfo.AddPoint.ToString()); + this.m_Tip.SetText((this.doc.BattleRoyaleDataInfo.SelfRank == 1u) ? XStringDefineProxy.GetString("BattleRoyaleWin") : XStringDefineProxy.GetString("BattleRoyaleFail")); + } + } +} -- cgit v1.1-26-g67d0