Progress Bar
using UnityEngine;
using Michsky.UI.Reach; // Reach UI namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private ProgressBar myBar;
void Start()
{
// Set the current value - requires updating
myBar.currentValue = 50;
// Set the current value
myBar.SetValue(50);
// Update the interface
myBar.UpdateUI();
// Set the min and max value
myBar.minValue = 0;
myBar.maxValue = 100;
// Add progress bar events
myBar.onValueChanged.AddListener(TestFunction);
}
void TestFunction(float value)
{
Debug.Log("Current value: " + value.ToString());
}
}
C#