Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TCExtraProgress.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.UI;
3
5{
6 public enum ProgressType
7 {
8 Gene
9 }
10
12
13 public GameObject goBar;
14
15 public Image bar;
16
17 public Image bgBar;
18
20
21 public float refreshInterval;
22
23 private float timer;
24
25 public override void OnSetOwner()
26 {
27 Refresh();
28 }
29
30 private void Update()
31 {
32 timer -= Core.delta;
33 if (timer < 0f)
34 {
36 Refresh();
37 }
38 }
39
40 public void Refresh()
41 {
42 if (base.owner == null)
43 {
44 return;
45 }
46 TraitGeneMachine traitGeneMachine = base.owner.trait as TraitGeneMachine;
47 bool flag = base.owner.isOn && base.owner.IsInstalled && traitGeneMachine.IsTargetUsingGene();
48 goBar.SetActive(flag);
49 if (flag)
50 {
51 float progress = traitGeneMachine.GetProgress();
52 bar.rectTransform.sizeDelta = new Vector2(progress * bgBar.rectTransform.sizeDelta.x, bgBar.rectTransform.sizeDelta.y);
53 if ((bool)textProgress)
54 {
55 textProgress.text = traitGeneMachine.GetProgressText();
56 }
57 }
58 }
59}
Definition: Core.cs:14
static float delta
Definition: Core.cs:17
ProgressType progressType
GameObject goBar
override void OnSetOwner()
string GetProgressText()
Definition: UIText.cs:6