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/BattleDebugHandler.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs b/Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs new file mode 100644 index 00000000..b4decf84 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class BattleDebugHandler : DlgHandlerBase + { + public XUIPool m_EnmityListPool = new XUIPool(XSingleton.singleton.m_uiTool); + + protected override void Init() + { + base.Init(); + Transform transform = base.PanelObject.transform.Find("template"); + this.m_EnmityListPool.SetupPool(transform.parent.gameObject, transform.gameObject, 10u, false); + } + + protected override void OnShow() + { + base.OnShow(); + this.m_EnmityListPool.ReturnAll(false); + } + + public override void OnUpdate() + { + base.OnUpdate(); + } + + public void UpdateEnmityList(List enmity) + { + this.m_EnmityListPool.ReturnAll(false); + for (int i = 0; i < enmity.Count; i++) + { + GameObject gameObject = this.m_EnmityListPool.FetchGameObject(false); + gameObject.transform.localPosition = new Vector3(this.m_EnmityListPool.TplPos.x, this.m_EnmityListPool.TplPos.y - (float)(i * this.m_EnmityListPool.TplHeight), this.m_EnmityListPool.TplPos.z); + IXUILabel ixuilabel = gameObject.transform.Find("name").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(enmity[i].entity.Name + ":" + enmity[i].value.ToString()); + } + } + } +} -- cgit v1.1-26-g67d0