Logo

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

StyleDescription
RadialA circular spinner. The fill amount oscillates and the image rotates, creating a smooth animated ring effect.
HorizontalA horizontal fill bar that ping-pongs left and right in idle mode, or fills left to right in progress mode.
VerticalSame as Horizontal but fills bottom to top.
SpriteSheetCycles through a list of sprites at a configurable frame rate. Supports both idle animation and progress-mapped frame selection.

Properties

Style

NameTypeDescription
barStyleBarStyleThe visual style of the bar.
rotationSpeedfloatSpeed multiplier for Radial rotation and Horizontal/Vertical ping-pong.
minFillAmountfloatMinimum fill used by the Radial idle oscillation.
maxFillAmountfloatMaximum fill used by the Radial idle oscillation.

Sprite Sheet

NameTypeDescription
spritesList<Sprite>Ordered list of sprites for the SpriteSheet style.
frameRatefloatPlayback speed in frames per second.

Loading Progress

NameTypeDescription
showLoadingProgressboolWhen enabled, the bar tracks real scene load progress instead of playing the idle animation.
enableSmoothingboolSmooths progress updates to avoid jarring jumps.
smoothingDurationfloatDuration of the smooth transition between progress values.
smoothingCurveAnimationCurveEasing curve applied to the smoothing lerp.

Progress Text

NameTypeDescription
progressTextTMP_TextOptional text element to display the progress value.
textFormatstringFormat string for the text. Use {0} as the value placeholder (e.g. {0}%).
displayFormatDisplayFormatNumeric format for the progress value. See the table below.

Display Formats

FormatExample Output
Fixed075
Fixed175.4
Fixed275.42
Fixed375.423
Number075
Number175.4
Number275.42
Number375.423

Number formats add locale-aware thousand separators (e.g. 1,234) while Fixed formats do not.

References

NameTypeDescription
barImageImageThe Image component driven by the bar. Auto-assigned from the same object if empty.
loadingScreenOverrideLoadingScreenOverride 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

MethodParametersDescription
Animate(value)boolStarts or stops the idle animation coroutine manually.
SetProgress(normalizedProgress)floatManually sets the displayed progress (0–1). Only works when showLoadingProgress is true.
SetBarStyle(style)BarStyleChanges the bar style at runtime and reconfigures the Image accordingly.

Code Example

CustomProgressBar.cs
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);
    }
}

On this page