UI Toolbox logoUI Toolbox

IndeterminateProgress

IndeterminateProgress makes a Unity ProgressBar show a bar that runs from the left to the right again and again. Use it for work of unknown length, as ProgressRing with indeterminate.

A progress bar with the title Connecting and a short accent bar that runs along its track

How to make a progress bar indeterminate:

<ui:ProgressBar name="loading" title="Loading…" />
var loading = root.Q<ProgressBar>("loading");
IndeterminateProgress.Set(loading, true);

// The length is known now: show the value again
IndeterminateProgress.Set(loading, false);
loading.value = 40;
Member Description
IndeterminateProgress.Set(bar, indeterminate) Starts (true) or stops (false) the moving bar. A second call with the same state does nothing.
IndeterminateProgress.USS_CLASS tb-progress-bar--indeterminate. It is on the progress bar while the bar moves.

Tips:

Styling

Class Element
tb-progress-bar--indeterminate The progress bar while it is indeterminate. Its unity-progress-bar__background clips the moving bar, and its unity-progress-bar__progress is hidden.
tb-progress-bar__runner The moving bar, in --tb-color-accent. Its width (30%) is its length.

To make the moving bar short and green:

.tb-progress-bar__runner { width: 15%; background-color: var(--tb-color-success); }