Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIBar.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.UI;
3
4public class UIBar : MonoBehaviour
5{
6 public Image image;
7
8 public Text textInfo;
9
10 public bool autoHide;
11
12 public void Refresh(float current, float max)
13 {
14 Refresh(current / max);
15 }
16
17 public void Refresh(float progress)
18 {
19 image.Rect().SetAnchor(0f, 0f, Mathf.Clamp(progress + 0.1f, 0.1f, 1f), 1f);
20 if (autoHide)
21 {
22 if (progress >= 1f && base.gameObject.activeSelf)
23 {
24 base.gameObject.SetActive(value: false);
25 }
26 else if (progress < 1f && !base.gameObject.activeSelf)
27 {
28 base.gameObject.SetActive(value: true);
29 }
30 }
31 }
32}
list. Refresh()
Definition: UIBar.cs:5
bool autoHide
Definition: UIBar.cs:10
void Refresh(float progress)
Definition: UIBar.cs:17
Text textInfo
Definition: UIBar.cs:8
Image image
Definition: UIBar.cs:6
void Refresh(float current, float max)
Definition: UIBar.cs:12