summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/BattleDebugHandler.cs
blob: b4decf84dfc23e2d3efa5d671b0c22211b35fcda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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());
			}
		}
	}
}