blob: 63958e783e1c8f138719aec4252128ef4d1ceda6 (
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
55
56
57
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<IXUISprite> m_scoreSprites = new List<IXUISprite>();
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++;
}
}
}
}
|