Logo

Loading Screen

The core component that manages the full loading lifecycle

Overview

Loading Screen is the central component of Evo Loader. It manages the entire transition lifecycle: fading in, loading the target scene asynchronously in the background, cycling hints and backgrounds, optionally waiting for player input, and finally fading out and destroying itself.

The component lives on a prefab that is instantiated at runtime when a load is triggered. It is never placed directly in a scene.


Creating a Loading Screen

The fastest way to get started is to duplicate one of the provided presets found at: Evo Loader -> Prefabs -> Loading Screens

Pick the one closest to what you need, duplicate it, and customize the copy. All references are already wired up so you can focus on visual changes rather than setup.

Building from Scratch

If you prefer to start clean, the loading screen prefab must have a LoadingScreen component at its root.

Create a new Canvas and add the Loading Screen component to the root object

Build your loading screen UI — background image, hint text, loading bar, etc.

Assign your UI references in the References foldout on the component

Save it as a prefab


Properties

Runtime

NameTypeDescription
LoadOperationAsyncOperationThe underlying Unity async load operation.

Animation

NameTypeDescription
fadeDurationfloatDuration of the canvas fade-in and fade-out.
contentFadeDelayfloatExtra delay before the inner content group fades in. Smooths the overall entry transition.
minimumDisplayTimefloatMinimum time (realtime seconds) the loading screen stays visible, even if the scene loads instantly.
afterLoadDelayfloatAdditional wait time after the scene activates, before the loading screen fades out.
startLoadAfterContentFadeboolWhen enabled, the scene load begins only after the content has fully faded in. Default is false — load starts immediately after the main canvas fades in.

Audio

NameTypeDescription
audioFade.modeAudioFadeModeWhich AudioSources to fade. Options: None, InterfaceObjects, SearchInScene, Explicit.
audioFade.fadeDurationfloatDuration of the audio fade.
audioFade.restoreOnCompleteboolRestores original volumes after the loading screen closes. Most useful for persistent sources in Additive or Transition Only modes.

Continue Input

NameTypeDescription
continueInput.modeContinueInputModeDisabled, AnyKey, or SpecificKey.
continueInput.specificKeyInputActionReference / KeyCodeThe action or key required when mode is SpecificKey.
continueInput.timeoutDurationfloatAuto-dismisses after this many seconds. Set 0 to disable.
continueInput.animationContentAnimationSettingsControls how the continue prompt container fades and slides in.

Time Scale

NameTypeDescription
setTimeScaleboolWhen enabled, Time.timeScale is overridden for the duration of loading.
targetTimeScalefloatThe time scale value applied during loading.

Hints

NameTypeDescription
hintDatabaseHintDatabaseScriptableObject containing hint entries.
hintContainerRectTransformRoot container of the hint UI. Requires (or receives) a CanvasGroup.
hintAnimationContentAnimationSettingsControls timing, fade, and optional slide for hint cycling.

Backgrounds

NameTypeDescription
backgroundDatabaseBackgroundDatabaseScriptableObject containing background sprites.
backgroundContainerRectTransformRoot container of the background UI. Requires (or receives) a CanvasGroup.
backgroundAnimationContentAnimationSettingsControls timing, fade, and optional slide for background cycling.

References

NameTypeDescription
contentGroupCanvasGroupThe inner group that fades in after the main canvas. Wrap all visible content in this group.
taskTextTextMeshProUGUIOptional text element that displays the description of the currently active task.
continueInputContainerRectTransformAnimated in when the continue prompt is active.
continueInputBarImageFill image driven from 1 to 0 over the timeout duration.
continueInputTextTextMeshProUGUIDisplays remaining timeout as a whole number.

Events

NameDescription
onLoadStartInvoked when the loading sequence begins (before the canvas fades in).
onTransitionCompleteInvoked after the content has faded in and the load is in progress.
onLoadCompleteInvoked just before the loading screen destroys itself.

Content Animation

Both hints and backgrounds share the ContentAnimationSettings structure, which controls how each piece of content cycles.

NameTypeDescription
displayDurationfloatHow long each item stays fully visible before cycling to the next.
pauseBetweenfloatGap between items (after fade-out, before next fade-in).
fadeDurationfloatDuration of the fade-in and fade-out.
enableSlideboolAdds a directional slide to the animation.
slideDurationfloatDuration of the slide motion.
slideCurveAnimationCurveEasing curve for the slide.
slideOffsetVector2Direction and distance of the slide in Canvas units.

Tasks

Tasks let you pause the loading screen until your own async operations complete — for example, fetching player data before activating the new scene.

TaskExample.cs
using Evo.Loader;
using UnityEngine;
using System.Collections;

public class TaskExample : MonoBehaviour
{
    public LoadingScreen loaderPrefab;

    public void StartLoad()
    {
        LoadParameters parameters = new()
        {
            targetScene = "GameScene",
            loadingScreen = loaderPrefab
        };

        // Register a callback once the loading screen exists
        parameters.onLoadStart.AddListener(RegisterTasks);

        // Then load the scene
        LoadingScreen.LoadScene(parameters);
    }

    void RegisterTasks()
    {
        LoadingScreen instance = LoadingScreen.GetInstance();
        instance.AddTask("fetch-data", "Fetching player data...");
        StartCoroutine(FetchDataCoroutine());
    }

    IEnumerator FetchDataCoroutine()
    {
        // Simulate an async operation
        yield return new WaitForSeconds(2f);

        // Mark the task complete — the loader will now proceed
        LoadingScreen.GetInstance().CompleteTask("fetch-data");
    }
}

Task Methods

MethodParametersDescription
AddTask(taskId, description)string, stringAdds a named task to the queue. The loader waits until all tasks are complete.
CompleteTask(taskId)stringMarks a task as complete.

Public API

Static Methods

MethodParametersDescription
LoadScene(parameters)LoadParametersLoads a scene with full parameter control.
LoadScene(sceneName)stringLoads by name using the Default prefab from EvoLoaderConfig.
LoadScene(sceneName, loaderPrefab)string, LoadingScreenLoads by name using a specific prefab.
LoadSceneAdditive(sceneName)stringAdditive load using the Default prefab.
LoadSceneAdditive(sceneName, loaderPrefab)string, LoadingScreenAdditive load using a specific prefab.
ShowTransition()NoneShows the loading screen without loading a scene.
ShowTransition(loaderPrefab)LoadingScreenSame as above, with a specific prefab.
GetInstance()NoneReturns the first active loading screen instance.
GetInstance(targetScene)stringReturns the instance loading a specific scene — useful when running concurrent loads.

Instance Methods

MethodParametersDescription
AddTask(taskId, description)string, stringAdds a task to the queue.
CompleteTask(taskId)stringMarks a task as complete.
NotifyInputReceived()NoneManually signals that continue input was received.

Load Parameters

LoadParameters is passed to LoadingScreen.LoadScene() to fully configure a load.

FieldTypeDescription
targetScenestringThe scene to load. Must be added to Build Settings.
loadingScreenLoadingScreenPrefab reference. Takes priority over LoaderName.
loadModeLoadModeSingle, Additive, or TransitionOnly.
useEmptySceneBufferboolForces a full unload and GC pass between scenes. Only applies to Single mode.
audioSourcesToFadeList<AudioSource>Sources to fade when AudioFadeMode is set to Explicit.
onLoadStartUnityEventFired when loading begins.
onLoadCompleteUnityEventFired just before the loading screen is destroyed.

Code Example

LoadingScreenExample.cs
using Evo.Loader;
using UnityEngine;
using System.Collections;

public class LoadingScreenExample : MonoBehaviour
{
    [Header("Prefab References")]
    public LoadingScreen defaultLoader;
    public LoadingScreen bossLoader;

    // Basic load
    public void LoadMainMenu()
    {
        // Direct prefab reference — works from anywhere
        LoadingScreen.LoadScene("MainMenu", defaultLoader);

        // Without a reference
        // Uses the default screen from the config asset (Evo Loader/Resources/EvoDefaultConfig.asset)
        LoadingScreen.LoadScene("MainMenu");
    }

    // Advanced load
    public void LoadBossArena()
    {
        LoadParameters parameters = new()
        {
            targetScene = "BossArena",
            loadingScreen = bossLoader,
            loadMode = LoadMode.Single,
            useEmptySceneBuffer = true  // flush memory between heavy scenes
        };

        parameters.onLoadStart.AddListener(() => Debug.Log("Entering boss area..."));
        parameters.onLoadComplete.AddListener(() => Debug.Log("Arena ready!"));

        LoadingScreen.LoadScene(parameters);
    }

    // Transition only
    public void ShowSplash()
    {
        // Show the loading screen without loading any scene
        // You can specify minimum display time in your prefab
        LoadingScreen instance = LoadingScreen.ShowTransition(defaultLoader);
    }

    // Load with a task
    public void LoadWithDataFetch()
    {
        LoadParameters parameters = new()
        {
            targetScene = "GameScene",
            loadingScreen = defaultLoader
        };

        parameters.onLoadStart.AddListener(() =>
        {
            LoadingScreen instance = LoadingScreen.GetInstance();
            instance.AddTask("fetch-save", "Loading save data...");
            StartCoroutine(FetchSaveData());
        });

        LoadingScreen.LoadScene(parameters);
    }

    IEnumerator FetchSaveData()
    {
        yield return new WaitForSeconds(1.5f); // simulate async work
        LoadingScreen.GetInstance().CompleteTask("fetch-save");
    }
}

On this page