Learn / Documentation / Scene Loader
Scripting

Description

The Scene Loader loads any Scene either by scene name or scene build index and updates a Progressor to show the loading progress. It can also trigger a set of 'actions' when the scene started loading (at 0% load progress) and/or when the scene has been loaded (but not activated) (at 90% load progress)

Component Details

Gesture Listener
Gesture Listener
  • Manual – Link to the manual page for this component

  • YouTube – Link to the quick video tutorial for this component

  • Debug Mode – Enables relevant debug messages to be printed to the console

  • Load Scene Mode – Determines how the new scene is loaded by this SceneLoader if the load scene method is called without any parameters (Single or Additive)

  • Get Scene By – Determines what load method this SceneLoader will use by default if the load scene method is called without any parameters  (Scene Name or Build Index)

  • Scene Name – Name or path of the Scene to load (when GetSceneBy is set to GetSceneBy.Name)

  • Build Index – Index of the Scene in the Build Settings to load (when GetSceneBy is set to GetSceneBy.BuildIndex)

  • Allow Scene Activation – Allow Scenes to be activated as soon as it is ready. When loading a scene, Unity first loads the scene (load progress from 0% to 90%) and then activates it (load progress from 90% to 100%). It’s a two state process. This option can stop the scene activation (at 90% load progress), after the scene has been loaded and is ready. Useful if you need to load several scenes at once and activate them in a specific order and/or at a specific time.

  • Scene Activation Delay – Sets for how long will the SceneLoader wait, after a scene has been loaded, before it starts the scene activation process (works only if AllowSceneActivation is enabled). When loading a scene, Unity first loads the scene (load progress from 0% to 90%) and then activates it (load progress from 90% to 100%). It’s a two state process. This delay is after the scene has been loaded and before its activation (at 90% load progress)

  • Load Behavior – Behavior when loading a scene

  • Progressor – Reference to a Progressor that allows animating anything (texts, images, animations…) in order to show the current scene load progress in a visual manner

  • OnProgressChangedProgressEvent triggered when an async operation is running and its progress has been updated. Passes the Progress (float between 0 and 1)

  • OnInverseProgressChangedProgressEvent triggered when an async operation is running and its progress has been updated. Passes the InverseProgress (float between 1 and 0). InverseProgress = 1 – Progress

Gesture Listener
Gesture Listener

Load Behavior

  • On Load Scene (0%)UIAction executed when the SceneLoader started loading a Scene

  • On Scene Loaded (90%)UIAction executed when the Scene has been loaded (the progress is at 0.9 (90%)) and has not been activated yet (the reset 0.1 (10%)). When loading a scene, Unity first loads the scene (load progress from 0% to 90%) and then activates it (load progress from 90% to 100%). It’s a two state process. This action is triggered after the scene has been loaded and before its activation (at 90% load progress)