summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/GuildMinePVPBattleHandler.cs115
1 files changed, 115 insertions, 0 deletions
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>(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<BattleMain, BattleMainBehaviour>.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<BattleMain, BattleMainBehaviour>.singleton.SetLeftTime(time, -1);
+ }
+ }
+}