Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
TCExtraProgress.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
using
UnityEngine.UI;
3
4
public
class
TCExtraProgress
:
TCExtraUI
5
{
6
public
enum
ProgressType
7
{
8
Gene
9
}
10
11
public
ProgressType
progressType
;
12
13
public
GameObject
goBar
;
14
15
public
Image
bar
;
16
17
public
Image
bgBar
;
18
19
public
UIText
textProgress
;
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
{
35
timer
+=
refreshInterval
;
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
}
Core
Definition:
Core.cs:14
Core.delta
static float delta
Definition:
Core.cs:17
TCExtraProgress
Definition:
TCExtraProgress.cs:5
TCExtraProgress.refreshInterval
float refreshInterval
Definition:
TCExtraProgress.cs:21
TCExtraProgress.Update
void Update()
Definition:
TCExtraProgress.cs:30
TCExtraProgress.progressType
ProgressType progressType
Definition:
TCExtraProgress.cs:11
TCExtraProgress.textProgress
UIText textProgress
Definition:
TCExtraProgress.cs:19
TCExtraProgress.bar
Image bar
Definition:
TCExtraProgress.cs:15
TCExtraProgress.timer
float timer
Definition:
TCExtraProgress.cs:23
TCExtraProgress.Refresh
void Refresh()
Definition:
TCExtraProgress.cs:40
TCExtraProgress.goBar
GameObject goBar
Definition:
TCExtraProgress.cs:13
TCExtraProgress.ProgressType
ProgressType
Definition:
TCExtraProgress.cs:7
TCExtraProgress.ProgressType.Gene
@ Gene
TCExtraProgress.OnSetOwner
override void OnSetOwner()
Definition:
TCExtraProgress.cs:25
TCExtraProgress.bgBar
Image bgBar
Definition:
TCExtraProgress.cs:17
TCExtraUI
Definition:
TCExtraUI.cs:2
TraitGeneMachine
Definition:
TraitGeneMachine.cs:4
TraitGeneMachine.GetProgressText
string GetProgressText()
Definition:
TraitGeneMachine.cs:48
TraitGeneMachine.GetProgress
float GetProgress()
Definition:
TraitGeneMachine.cs:33
TraitGeneMachine.IsTargetUsingGene
bool IsTargetUsingGene()
Definition:
TraitGeneMachine.cs:28
UIText
Definition:
UIText.cs:6
Elin
TCExtraProgress.cs
Generated by
1.9.6