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
Using a Preset (Recommended)
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
| Name | Type | Description |
|---|---|---|
LoadOperation | AsyncOperation | The underlying Unity async load operation. |
Animation
| Name | Type | Description |
|---|---|---|
fadeDuration | float | Duration of the canvas fade-in and fade-out. |
contentFadeDelay | float | Extra delay before the inner content group fades in. Smooths the overall entry transition. |
minimumDisplayTime | float | Minimum time (realtime seconds) the loading screen stays visible, even if the scene loads instantly. |
afterLoadDelay | float | Additional wait time after the scene activates, before the loading screen fades out. |
loadAfterContentFade | bool | When 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. |
Custom Transitions
| Name | Type | Description |
|---|---|---|
startTransitionPrefab | LoadingTransition | Optional transition played when the loading screen opens. The transition covers the screen first, then the loading screen appears instantly beneath it before the transition dissolves away. Leave null to use the standard canvas fade-in. |
endTransitionPrefab | LoadingTransition | Optional transition played when the loading screen closes. The transition covers the loading screen, which is then hidden instantly before the transition dissolves to reveal the new scene. Leave null to use the standard canvas fade-out. |
Audio
| Name | Type | Description |
|---|---|---|
audioFade.mode | AudioFadeMode | Which AudioSources to fade. Options: None, AudioFaderObjects, SearchInScene, Explicit. |
audioFade.fadeDuration | float | Duration of the audio fade. |
audioFade.restoreOnComplete | bool | Restores original volumes after the loading screen closes. Most useful for persistent sources in Additive or Transition Only modes. |
Continue Input
| Name | Type | Description |
|---|---|---|
continueInput.mode | ContinueInputMode | Disabled, AnyKey, or SpecificKey. |
continueInput.specificKey | InputActionReference / KeyCode | The action or key required when mode is SpecificKey. |
continueInput.timeoutDuration | float | Auto-dismisses after this many seconds. Set 0 to disable. |
continueInput.animation | ContentAnimationSettings | Controls how the continue prompt container fades and slides in. |
Time Scale
| Name | Type | Description |
|---|---|---|
setTimeScale | bool | When enabled, Time.timeScale is overridden for the duration of loading. |
targetTimeScale | float | The time scale value applied during loading. |
Hints
| Name | Type | Description |
|---|---|---|
hintDatabase | HintDatabase | ScriptableObject containing hint entries. |
hintContainer | RectTransform | Root container of the hint UI. Requires (or receives) a CanvasGroup. |
hintAnimation | ContentAnimationSettings | Controls timing, fade, and optional slide for hint cycling. |
Backgrounds
| Name | Type | Description |
|---|---|---|
backgroundDatabase | BackgroundDatabase | ScriptableObject containing background sprites. |
backgroundContainer | RectTransform | Root container of the background UI. Requires (or receives) a CanvasGroup. |
backgroundAnimation | ContentAnimationSettings | Controls timing, fade, and optional slide for background cycling. |
References
| Name | Type | Description |
|---|---|---|
contentGroup | CanvasGroup | The inner group that fades in after the main canvas. Wrap all visible content in this group. |
titleText | TextMeshProUGUI | Optional text element for displaying the loading screen title. |
descriptionText | TextMeshProUGUI | Optional text element for displaying the loading screen description. |
taskText | TextMeshProUGUI | Optional text element that displays the description of the currently active task. |
continueInputContainer | RectTransform | Animated in when the continue prompt is active. |
continueInputBar | Image | Fill image driven from 1 to 0 over the timeout duration. |
continueInputText | TextMeshProUGUI | Displays remaining timeout as a whole number. |
Events
| Name | Description |
|---|---|
onLoadStart | Invoked when the loading sequence begins (before the canvas fades in). |
onTransitionComplete | Invoked after the content has faded in and the load is in progress. |
onLoadComplete | Invoked just before the loading screen begins its fade-out. |
onTeardown | Invoked at the very start of teardown, before the loading screen fades out. |
Content Animation
Both hints and backgrounds share the ContentAnimationSettings structure, which controls how each piece of content cycles.
| Name | Type | Description |
|---|---|---|
displayDuration | float | How long each item stays fully visible before cycling to the next. |
pauseBetween | float | Gap between items (after fade-out, before next fade-in). |
fadeDuration | float | Duration of the fade-in and fade-out. |
enableSlide | bool | Adds a directional slide to the animation. |
slideDuration | float | Duration of the slide motion. |
slideCurve | AnimationCurve | Easing curve for the slide. |
slideOffset | Vector2 | Direction 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.
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
| Method | Parameters | Description |
|---|---|---|
AddTask(taskId, description) | string, string | Adds a named task to the queue. The loader waits until all tasks are complete. |
CompleteTask(taskId) | string | Marks a task as complete. |
Public API
Static Methods
| Method | Parameters | Description |
|---|---|---|
LoadScene(parameters) | LoadParameters | Loads a scene with full parameter control. |
LoadScene(sceneName) | string | Loads by name using the Default prefab from EvoLoaderConfig. |
LoadScene(sceneName, loaderPrefab) | string, LoadingScreen | Loads by name using a specific prefab. |
LoadSceneAdditive(sceneName, loaderPrefab) | string, LoadingScreen | Additive load using a specific prefab. |
ShowTransition(loaderPrefab) | LoadingScreen | Shows the loading screen without loading a scene. |
GetInstance() | None | Returns the first active loading screen instance. |
GetInstance(targetScene) | string | Returns the instance loading a specific scene — useful when running concurrent loads. |
GetInstance(loader) | LoadingScreen | Returns the instance that was started with the given loader prefab. |
Instance Methods
| Method | Parameters | Description |
|---|---|---|
AddTask(taskId, description) | string, string | Adds a task to the queue. |
CompleteTask(taskId) | string | Marks a task as complete. |
NotifyInputReceived() | None | Manually signals that continue input was received. |
Load Parameters
LoadParameters is passed to LoadingScreen.LoadScene() to fully configure a load.
| Field | Type | Description |
|---|---|---|
targetScene | string | The scene to load. Must be added to Build Settings. |
loadingScreen | LoadingScreen | Prefab reference. Takes priority over LoaderName. |
loadMode | LoadMode | Single, Additive, or TransitionOnly. |
useEmptySceneBuffer | bool | Forces a full unload and GC pass between scenes. Only applies to Single mode. |
audioSourcesToFade | List<AudioSource> | Sources to fade when AudioFadeMode is set to Explicit. |
onLoadStart | UnityEvent | Fired when loading begins. |
onLoadComplete | UnityEvent | Fired just before the loading screen is destroyed. |
Code Example
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");
}
}