Progress Bar
Workflow
You can use the progress bar as health bar, mana bar, and so on. There are many customization options available, such as; prefixes, suffixes, decimals and much more.
Scripting
using UnityEngine;
using Michsky.UI.Heat; // Heat 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());
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.