summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.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/UI/BattleDebugHandler.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs43
1 files changed, 43 insertions, 0 deletions
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<XGameUI>.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> 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());
+ }
+ }
+ }
+}