35 lines
960 B
C#
35 lines
960 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace BrewMonster.UI
|
|
{
|
|
//Win_Prgs2
|
|
public class DlgWinPrgs2 : AUIDialog
|
|
{
|
|
[SerializeField] private Slider progressSlider; // Slider bar
|
|
[SerializeField] private TMPro.TextMeshProUGUI progressText; // Progress text
|
|
|
|
/// <summary>
|
|
/// Set the slider's value and text at the same time
|
|
/// </summary>
|
|
/// <param name="value">Progress percentage (0~1)</param>
|
|
/// <param name="text"></param>
|
|
public void SetProgressAndText(float value, string text)
|
|
{
|
|
if (progressSlider != null)
|
|
{
|
|
progressSlider.value = Mathf.Clamp01(value);
|
|
}
|
|
|
|
if (progressText != null)
|
|
{
|
|
progressText.text = text;
|
|
}
|
|
}
|
|
|
|
public void SetActiveProgress(bool active)
|
|
{
|
|
progressSlider.gameObject.SetActive(active);
|
|
}
|
|
}
|
|
} |