From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/GuildArenaBattleDuelTeamInfo.cs | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/GuildArenaBattleDuelTeamInfo.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/GuildArenaBattleDuelTeamInfo.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/GuildArenaBattleDuelTeamInfo.cs b/Client/Assets/Scripts/XMainClient/UI/GuildArenaBattleDuelTeamInfo.cs new file mode 100644 index 00000000..63958e78 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/GuildArenaBattleDuelTeamInfo.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; + +namespace XMainClient.UI +{ + public class GuildArenaBattleDuelTeamInfo + { + private Transform transform; + + private IXUILabel m_damageLabel; + + private IXUILabel m_killLabel; + + private List m_scoreSprites = new List(); + + public void Init(Transform t) + { + this.transform = t; + this.m_damageLabel = (this.transform.Find("Damage").GetComponent("XUILabel") as IXUILabel); + this.m_killLabel = (this.transform.Find("Kill").GetComponent("XUILabel") as IXUILabel); + string format = "Score/Score{0}/Win"; + string format2 = "Score/Score{0}/Lose"; + for (int i = 1; i < 4; i++) + { + IXUISprite item = this.transform.Find(string.Format(format, i)).GetComponent("XUISprite") as IXUISprite; + this.m_scoreSprites.Add(item); + IXUISprite ixuisprite = this.transform.Find(string.Format(format2, i)).GetComponent("XUISprite") as IXUISprite; + ixuisprite.SetAlpha(0f); + } + this.Reset(); + } + + public void Set(GVGCombatInfo info) + { + this.Set(info.DamageString, info.KillCountString, info.Score); + } + + public void Reset() + { + this.Set("0", "0", 0); + } + + private void Set(string damage, string kill, int score) + { + this.m_damageLabel.SetText(damage); + this.m_killLabel.SetText(kill); + int i = 0; + int count = this.m_scoreSprites.Count; + while (i < count) + { + this.m_scoreSprites[i].SetAlpha((score > i) ? 1f : 0f); + i++; + } + } + } +} -- cgit v1.1-26-g67d0