From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/GuildMinePVPBattleHandler.cs | 115 +++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs b/Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs new file mode 100644 index 00000000..4b02fc7b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs @@ -0,0 +1,115 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class GuildMinePVPBattleHandler : DlgHandlerBase + { + protected override string FileName + { + get + { + return "Battle/SkyArenaBattle"; + } + } + + private XGuildMineBattleDocument doc = null; + + private Transform m_Info; + + private IXUILabel m_BlueScore; + + private IXUILabel m_RedScore; + + private IXUILabel m_BlueDamage; + + private IXUILabel m_RedDamage; + + private IXUILabel m_TimeLabel; + + private IXUILabel m_RestTip; + + protected override void Init() + { + base.Init(); + this.doc = XDocuments.GetSpecificDocument(XGuildMineBattleDocument.uuID); + this.doc.BattleHandler = this; + this.m_Info = base.transform.Find("Bg/Info"); + this.m_BlueScore = (base.transform.Find("Bg/Info/Blue/Score").GetComponent("XUILabel") as IXUILabel); + this.m_RedScore = (base.transform.Find("Bg/Info/Red/Score").GetComponent("XUILabel") as IXUILabel); + this.m_BlueDamage = (base.transform.Find("Bg/Info/Blue/Damage").GetComponent("XUILabel") as IXUILabel); + this.m_RedDamage = (base.transform.Find("Bg/Info/Red/Damage").GetComponent("XUILabel") as IXUILabel); + this.m_RestTip = (base.transform.Find("Bg/start").GetComponent("XUILabel") as IXUILabel); + this.m_TimeLabel = (base.transform.Find("Bg/Time").GetComponent("XUILabel") as IXUILabel); + } + + public override void RegisterEvent() + { + } + + protected override void OnShow() + { + base.OnShow(); + this.RefreshInfo(); + } + + protected override void OnHide() + { + base.OnHide(); + } + + public override void OnUnload() + { + this.doc.BattleHandler = null; + base.OnUnload(); + } + + public override void OnUpdate() + { + base.OnUpdate(); + } + + private void RefreshInfo() + { + this.m_BlueScore.SetText("0"); + this.m_RedScore.SetText("0"); + this.m_BlueDamage.SetText("0"); + this.m_RedDamage.SetText("0"); + DlgBase.singleton.HideLeftTime(); + this.m_RestTip.gameObject.SetActive(false); + this.m_TimeLabel.gameObject.SetActive(false); + } + + public void SetScore(uint score, bool isBlue) + { + if (isBlue) + { + this.m_BlueScore.SetText(score.ToString()); + } + else + { + this.m_RedScore.SetText(score.ToString()); + } + } + + public void SetDamage(ulong damage, bool isBlue) + { + if (isBlue) + { + this.m_BlueDamage.SetText(damage.ToString()); + } + else + { + this.m_RedDamage.SetText(damage.ToString()); + } + } + + public void RefreshStatusTime(uint time) + { + DlgBase.singleton.SetLeftTime(time, -1); + } + } +} -- cgit v1.1-26-g67d0