Sizing note:.ProgressBar(...) does not set Width/Height on the parent — set them yourself before the call. Pick orientation via .ProgressBar(mode, direction) — Linear bars need Width(W).Height(H) for horizontal or Width(W).HeightFill() for vertical.
Runtime Updates
// Update value (fires OnValueChanged)
m_LinearBar.Value =0.8f;
// Change colors
m_LinearBar.FillColor = Color.red;
m_LinearBar.TrackColor = Color.black;
// Toggle label
m_LinearBar.ShowLabel =true;
// Rebuild visuals (e.g., after switching mode)
m_LinearBar.Mode = ProgressBarMode.Radial;
m_LinearBar.RebuildVisuals();
Methods
Method
Description
RebuildVisuals()
Destroy and recreate children based on current mode
Properties
Property
Type
Description
Value
float
Progress (0-1), clamped
Mode
ProgressBarMode
Linear or Radial
TrackColor
Color
Background track color
FillColor
Color
Fill color
ShowLabel
bool
Show/hide percentage label
LabelFormat
string
Label format string
FillDirection
LinearFillDirection
Linear fill direction
StartAngle
float
Radial start angle
Clockwise
bool
Radial fill direction
ArcRange
float
Radial arc range
Events
Event
Signature
Description
OnValueChanged
Action<float>
Fires when Value changes
Builder API
Method
Description
.Value(float)
Set initial value (0-1)
.FillColor(Color)
Set fill color
.TrackColor(Color)
Set track color
.ShowLabel()
Enable percentage label
.LabelFormat(string)
Set label format
.FillDirection(LinearFillDirection)
Set linear fill direction
.StartAngle(float)
Set radial start angle
.Clockwise(bool)
Set radial direction
.ArcRange(float)
Set radial arc range
.Capture(Action<AutoLayoutProgressBar>)
Capture reference
.End()
Return to parent LayoutBuilder
Notes
The bar takes whatever Width/Height you set on the parent. There are no auto-defaults — set sizing explicitly before the .ProgressBar(...) call.
Label uses zero-GC SetText("{0}", value * 100f) internally.
Linear mode uses Image.Type.Filled with Horizontal/Vertical fill method.
Radial mode uses Image.Type.Filled with Radial360 fill method.
Changing Mode at runtime requires calling RebuildVisuals().