-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhaseInfoPanel.cs
58 lines (50 loc) · 1.32 KB
/
PhaseInfoPanel.cs
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 UnityEngine.UI;
public class PhaseInfoPanel : UIPanel
{
private Text _phaseNumber;
private Text _phaseName;
private bool _isShown = false;
public override void Initialise()
{
_isPanelActive = true;
_phaseName = gameObject.transform.Find("PhaseName").GetComponent<Text>();
_phaseNumber = gameObject.transform.Find("PhaseNumber").GetComponent<Text>();
}
public override void Refresh()
{
int phaseNumber = RoundSystem.Instance()._phase;
string phaseName = "";
switch(phaseNumber)
{
case 0:
phaseName = "Intro";
break;
case 1:
phaseName = "Move";
break;
case 2:
phaseName = "Shoot";
break;
case 3:
phaseName = "Evade";
break;
case 4:
phaseName = "Reward";
break;
}
_phaseNumber.text = phaseNumber.ToString();
_phaseName.text = phaseName;
}
public void Show()
{
if (_isShown)
return;
_isShown = true;
this.gameObject.SetActive(true);
}
public new void Disable()
{
_isShown = false;
this.gameObject.SetActive(false);
}
}