Loading Bar
Animated spinner or progress-tracking bar for the loading screen
Overview
Loading Bar is an optional component that can be placed on any Image inside your loading screen prefab. You can open the Bars scene to see them all visually.
It supports two modes:
- Idle animation that plays while loading
- Progress mode that tracks the actual scene load percentage
Usage
You can either use provided presets, or create on your own.
Use Presets
Select a loading screen prefab and double-click to open it
Expand the Content section and click the Replace Loading Bar button
This will open a menu where you can select from any presets available in your project
You can alternatively drag and drop prefabs into the Loading Bar container the old-fashioned way.
Create New Presets
Add an Image component to a UI object inside your loader prefab
Add the Loading Bar component to the same object
Set a Bar Style and configure its settings
Enable Show Loading Progress if you want the bar to reflect real load progress
If barImage is left empty, the component attempts to find an Image on the same object automatically.
Bar Styles
| Style | Description |
|---|---|
Radial | A circular spinner. The fill amount oscillates and the image rotates, creating a smooth animated ring effect. |
Horizontal | A horizontal fill bar that ping-pongs left and right in idle mode, or fills left to right in progress mode. |
Vertical | Same as Horizontal but fills bottom to top. |
SpriteSheet | Cycles through a list of sprites at a configurable frame rate. Supports both idle animation and progress-mapped frame selection. |
Properties
Style
| Name | Type | Description |
|---|---|---|
barStyle | BarStyle | The visual style of the bar. |
rotationSpeed | float | Speed multiplier for Radial rotation and Horizontal/Vertical ping-pong. |
minFillAmount | float | Minimum fill used by the Radial idle oscillation. |
maxFillAmount | float | Maximum fill used by the Radial idle oscillation. |
Sprite Sheet
| Name | Type | Description |
|---|---|---|
sprites | List<Sprite> | Ordered list of sprites for the SpriteSheet style. |
frameRate | float | Playback speed in frames per second. |
Loading Progress
| Name | Type | Description |
|---|---|---|
showLoadingProgress | bool | When enabled, the bar tracks real scene load progress instead of playing the idle animation. |
enableSmoothing | bool | Smooths progress updates to avoid jarring jumps. |
smoothingDuration | float | Duration of the smooth transition between progress values. |
smoothingCurve | AnimationCurve | Easing curve applied to the smoothing lerp. |
Progress Text
| Name | Type | Description |
|---|---|---|
progressText | TMP_Text | Optional text element to display the progress value. |
textFormat | string | Format string for the text. Use {0} as the value placeholder (e.g. {0}%). |
displayFormat | DisplayFormat | Numeric format for the progress value. See the table below. |
Display Formats
| Format | Example Output |
|---|---|
Fixed0 | 75 |
Fixed1 | 75.4 |
Fixed2 | 75.42 |
Fixed3 | 75.423 |
Number0 | 75 |
Number1 | 75.4 |
Number2 | 75.42 |
Number3 | 75.423 |
Number formats add locale-aware thousand separators (e.g. 1,234) while Fixed formats do not.
References
| Name | Type | Description |
|---|---|---|
barImage | Image | The Image component driven by the bar. Auto-assigned from the same object if empty. |
loadingScreenOverride | LoadingScreen | Override which LoadingScreen instance to poll for progress. Leave empty to fetch automatically. |
Idle vs Progress Mode
Idle mode (showLoadingProgress = false) runs a looping animation that plays regardless of actual load progress. It is well suited for loaders where the exact percentage is not important, or for the TransitionOnly load mode.
Progress mode (showLoadingProgress = true) polls the active LoadingScreen instance every frame and maps its AsyncOperation.progress to the bar's fill amount.
Unity's AsyncOperation.progress caps at 0.9 before scene activation. LoadingBar normalises this to a clean 0–1 range automatically.
Public Methods
| Method | Parameters | Description |
|---|---|---|
Animate(value) | bool | Starts or stops the idle animation coroutine manually. |
SetProgress(normalizedProgress) | float | Manually sets the displayed progress (0–1). Only works when showLoadingProgress is true. |
SetBarStyle(style) | BarStyle | Changes the bar style at runtime and reconfigures the Image accordingly. |
Code Example
using Evo.Loader;
using UnityEngine;
public class CustomProgressBar : MonoBehaviour
{
public LoadingBar loadingBar;
void Start()
{
// Switch to a horizontal progress bar at runtime
loadingBar.SetBarStyle(LoadingBar.BarStyle.Horizontal);
// Manually drive progress (e.g. from a custom download)
StartCoroutine(SimulateDownload());
}
System.Collections.IEnumerator SimulateDownload()
{
float progress = 0f;
while (progress < 1f)
{
progress += Time.deltaTime * 0.2f;
loadingBar.SetProgress(progress);
yield return null;
}
loadingBar.SetProgress(1f);
}
}