Elin Modding Docs Doc
Loading...
Searching...
No Matches
TCExtraProgress.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x0200017B RID: 379
7{
8 // Token: 0x06000B02 RID: 2818 RVA: 0x00044953 File Offset: 0x00042B53
9 public override void OnSetOwner()
10 {
11 this.Refresh();
12 }
13
14 // Token: 0x06000B03 RID: 2819 RVA: 0x0004495B File Offset: 0x00042B5B
15 private void Update()
16 {
17 this.timer -= Core.delta;
18 if (this.timer < 0f)
19 {
20 this.timer += this.refreshInterval;
21 this.Refresh();
22 }
23 }
24
25 // Token: 0x06000B04 RID: 2820 RVA: 0x00044998 File Offset: 0x00042B98
26 public void Refresh()
27 {
28 if (base.owner == null)
29 {
30 return;
31 }
32 TraitGeneMachine traitGeneMachine = base.owner.trait as TraitGeneMachine;
33 bool flag = base.owner.isOn && base.owner.IsInstalled && traitGeneMachine.IsTargetUsingGene();
34 this.goBar.SetActive(flag);
35 if (flag)
36 {
37 float progress = traitGeneMachine.GetProgress();
38 this.bar.rectTransform.sizeDelta = new Vector2(progress * this.bgBar.rectTransform.sizeDelta.x, this.bgBar.rectTransform.sizeDelta.y);
39 if (this.textProgress)
40 {
41 this.textProgress.text = traitGeneMachine.GetProgressText();
42 }
43 }
44 }
45
46 // Token: 0x04000A13 RID: 2579
47 public TCExtraProgress.ProgressType progressType;
48
49 // Token: 0x04000A14 RID: 2580
50 public GameObject goBar;
51
52 // Token: 0x04000A15 RID: 2581
53 public Image bar;
54
55 // Token: 0x04000A16 RID: 2582
56 public Image bgBar;
57
58 // Token: 0x04000A17 RID: 2583
59 public UIText textProgress;
60
61 // Token: 0x04000A18 RID: 2584
62 public float refreshInterval;
63
64 // Token: 0x04000A19 RID: 2585
65 private float timer;
66
67 // Token: 0x02000886 RID: 2182
68 public enum ProgressType
69 {
70 // Token: 0x04002478 RID: 9336
71 Gene
72 }
73}