summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/HeroBattleTeam.cs
blob: e4f9b5df887530bb239b9e69121b9871475762db (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
44
45
46
47
48
49
50
51
52
53
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);
			}
		}
	}
}