Files
plugin-library/Assets/00.StaryEvoTools/Runtime/PanelTools/ProgressBarPanel.cs

35 lines
956 B
C#
Raw Normal View History

2025-07-02 10:05:26 +08:00
using UnityEngine;
using UnityEngine.UI;
namespace Main
{
public class ProgressBarPanel : MonoBehaviour
{
private Image _fill;
private Text _fillText;
private Text _fillMessage;
private void Awake()
{
_fill = this.transform.Find("Fill").GetComponent<Image>();
_fillText = _fill.transform.Find("FillText").GetComponent<Text>();
_fillMessage = _fill.transform.Find("FillMessage").GetComponent<Text>();
2025-11-03 14:25:56 +08:00
//_fill.fillAmount = 0;
2025-07-02 10:05:26 +08:00
_fillText.text = "0%";
}
public async void SetProgressBarValue(string message, float value)
{
this.gameObject.SetActive(true);
2025-11-03 14:25:56 +08:00
//_fill.fillAmount = value;
2025-07-02 10:05:26 +08:00
_fillMessage.text = message;
_fillText.text = $"{value:P0}";
if (value >= 1)
{
this.gameObject.SetActive(false);
}
}
}
}