SceneLoader

February 9, 2024 ยท View on GitHub

Namespace: Unity.SceneManagement


Summary:

SceneLoader is a component designed to load a specified asset scene. It manages scene loading and unloading, tracks loading progress, and provides event notifications when a scene is loaded or unloaded.

Features and Operation:

  • Scene Loading: Asynchronously loads the specified asset scene.
  • Loading Progress Tracking: Tracks the progress of the loading process and provides a progress percentage.
  • Load Completion Event: Triggers an OnLoaded event when the scene is loaded.
  • Scene Unloading: Unloads the specified scene.
  • Unload Event: Triggers an OnUnloaded event when the scene is unloaded.

Properties

NameDescription
_sceneThe asset reference of the scene to be loaded.
_priorityPriority of the scene loading.
_isActiveWhether to set the loaded scene as the active scene.
OnLoadedEvent triggered when the scene is loaded.
OnUnloadedEvent triggered when the scene is unloaded.
IsLoadedIndicates whether the scene is loaded.
InProgressIndicates whether the scene loading is in progress.
ProgressCurrent loading progress percentage.
SceneThe loaded scene.

Methods

  • There are no public methods.