From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/UI/HeroBattleTeam.cs | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/HeroBattleTeam.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/HeroBattleTeam.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/HeroBattleTeam.cs b/Client/Assets/Scripts/XMainClient/UI/HeroBattleTeam.cs new file mode 100644 index 00000000..e4f9b5df --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/HeroBattleTeam.cs @@ -0,0 +1,54 @@ +using System; +using UILib; +using UnityEngine; + +namespace XMainClient.UI +{ + internal class HeroBattleTeam + { + public uint Score + { + set + { + bool flag = this._score != value; + if (flag) + { + this._score = value; + this.m_Score.SetText(string.Format("{0}%", this._score)); + } + } + } + + public GameObject m_OccupantCircle; + + public IXUIProgress m_Ring; + + public IXUILabel m_Score; + + private uint _score = 0u; + + public HeroBattleTeam(Transform ts) + { + this.m_Ring = (ts.Find("Ring").GetComponent("XUIProgress") as IXUIProgress); + this.m_Ring.value = 0f; + this.m_Score = (ts.Find("Score").GetComponent("XUILabel") as IXUILabel); + this.m_Score.SetText("0%"); + this.m_OccupantCircle = ts.Find("Circle").gameObject; + this.m_OccupantCircle.transform.localPosition = XGameUI.Far_Far_Away; + } + + public void SetOccupyValue(float value) + { + this.m_Ring.value = value; + } + + public void SetOccupantState(bool state) + { + this.m_OccupantCircle.transform.localPosition = (state ? Vector3.zero : XGameUI.Far_Far_Away); + if (state) + { + this.SetOccupyValue(0f); + } + } + } +} -- cgit v1.1-26-g67d0