UI Elements
Progress Bar A flexible progress bar with smoothing
Progress Bar displays a numeric value between a minimum and maximum range and visually represents the percentage using a UI bar. It supports horizontal and vertical fill directions, number formatting, text prefixes, animation smoothing, and both Image fill mode and RectTransform anchor filling.
The component updates its text and fill amount whenever the value changes, and can animate toward its target smoothly using an easing curve.
This is ideal for loading bars, HP bars, XP bars, crafting progress, ability cooldowns, or any UI where a numeric range should be displayed.
Name Type Description ValuefloatCurrent value (clamped between MinValue and MaxValue) MinValuefloatMinimum limit MaxValuefloatMaximum limit
Name Type Description invokeAtStartboolInvokes onValueChanged on Start isVerticalboolUses vertical fill instead of horizontal displayMultiplierfloatMultiplier applied before displaying text displayFormatDisplayFormatFixed or thousands number formatting textFormatstringFormat containing 0 placeholder
Name Type Description enableSmoothingboolEnables animated transitions smoothingDurationfloatDuration of smoothing animation smoothingCurveAnimationCurveEasing for smoothed transitions
Name Type Description fillRectRectTransformRectTransform or Image used to visually represent progress valueTextTMP_TextOptional text display for the current value
Name Type Description onValueChangedUnityEvent<float>Fired when Value changes
Name Parameters Description SetValue(newValue)floatSets a new value and optionally animates SetValueInstant(newValue)floatSets value immediately without smoothing SetValueWithoutNotify(newValue)floatUpdates visually without triggering onValueChanged GetFormatString()None Returns format string used internally FormatValue(value)floatReturns formatted text for a value
using UnityEngine ;
using Evo . UI ;
public class ProgressBarExample : MonoBehaviour
{
public ProgressBar bar ;
void Start ()
{
// Set values instantly
bar.MinValue = 0 ;
bar.MaxValue = 200 ;
bar. SetValueInstant ( 50 );
// Animate to new value
bar. SetValue ( 150 );
// With multiplier and custom text
bar.displayMultiplier = 100 ;
bar.textFormat = "{0}%" ;
// Hook event
bar.onValueChanged. AddListener ( v =>
{
Debug. Log ( "Progress updated: " + v);
});
}
void Update ()
{
// Example: animate from 0 to max
if (Input. GetKeyDown (KeyCode.Space))
{
bar. SetValue ( 200 );
}
}
}