Additive Scene Manager
An API For Level Streaming in Unity.
Loading...
Searching...
No Matches

Saves and manages a list of Startup Scenes, Persistent Scenes, and Loaded Scenes. More...

Public Member Functions

void PopulateLoadedScenesList ()
 Internal function: Find all loaded scenes and add them to the list.

Public Attributes

List< AdditiveScenestartScenes = new List<AdditiveScene>()
 Scenes to load at start.
List< AdditiveScenepersistentScenes = new List<AdditiveScene>()
 Scenes that cannot be unloaded.
List< AdditiveSceneloadedScenes = new List<AdditiveScene>()
 Currently loaded scenes.
PanelSettings panelSettingsInGameUI
 The PanelSettings asset used to render the In-Game UI.

Properties

static SceneControllerSettings Instance [get]
 Static singleton of this ScriptableObject.

Private Member Functions

void OnActiveSceneChanged (Scene oldScene, Scene newScene)
 Called when the SceneManager.activeSceneChanged event is raised, updates the Loaded Scenes list.
void OnSceneUnloaded (Scene scene)
 Called when the SceneManager.sceneUnloaded event is raised, updates the Loaded Scenes list.
void OnSceneLoaded (Scene scene, LoadSceneMode loadSceneMode)
 Called when the SceneManager.sceneLoaded event is raised, updates the Loaded Scenes list.
AdditiveScene AddToLoadedScenesAt (Scene scene, int index)
 Add a scene to the list of loaded scenes.
void RemoveFromLoadedScenes (Scene scene)
 Remove a scene from the list of loaded scenes.
float GetAsyncProgress (string sceneName)
 Returns the Async Operation's progress for a scene that is loading.

Detailed Description

Saves and manages a list of Startup Scenes, Persistent Scenes, and Loaded Scenes.

A singleton of this class exists at SceneControllerSettings.Instance.

Member Function Documentation

◆ AddToLoadedScenesAt()

AdditiveScene AddToLoadedScenesAt ( Scene scene,
int index )
private

Add a scene to the list of loaded scenes.

An AdditiveScene class will be created and added to the list.

Parameters
sceneThe scene to add to the list.
Returns
Creates an AdditiveScene, adds it to the list, and returns the AdditiveScene.

◆ GetAsyncProgress()

float GetAsyncProgress ( string sceneName)
private

Returns the Async Operation's progress for a scene that is loading.

Parameters
sceneNameThe name of a scene that is currently loading.

◆ OnActiveSceneChanged()

void OnActiveSceneChanged ( Scene oldScene,
Scene newScene )
private

Called when the SceneManager.activeSceneChanged event is raised, updates the Loaded Scenes list.

Parameters
oldSceneThe previous Active Scene.
newSceneThe new Active Scene.

◆ OnSceneLoaded()

void OnSceneLoaded ( Scene scene,
LoadSceneMode loadSceneMode )
private

Called when the SceneManager.sceneLoaded event is raised, updates the Loaded Scenes list.

Parameters
sceneThe scene that was loaded.
loadSceneModeWill always be LoadSceneMode.Additive.

◆ OnSceneUnloaded()

void OnSceneUnloaded ( Scene scene)
private

Called when the SceneManager.sceneUnloaded event is raised, updates the Loaded Scenes list.

Parameters
sceneThe scene that was unloaded.

◆ PopulateLoadedScenesList()

void PopulateLoadedScenesList ( )

Internal function: Find all loaded scenes and add them to the list.

◆ RemoveFromLoadedScenes()

void RemoveFromLoadedScenes ( Scene scene)
private

Remove a scene from the list of loaded scenes.

Parameters
sceneThe scene the remove from the list.

Member Data Documentation

◆ loadedScenes

List<AdditiveScene> loadedScenes = new List<AdditiveScene>()

Currently loaded scenes.

◆ panelSettingsInGameUI

PanelSettings panelSettingsInGameUI

The PanelSettings asset used to render the In-Game UI.

◆ persistentScenes

List<AdditiveScene> persistentScenes = new List<AdditiveScene>()

Scenes that cannot be unloaded.

◆ startScenes

List<AdditiveScene> startScenes = new List<AdditiveScene>()

Scenes to load at start.

Property Documentation

◆ Instance

SceneControllerSettings Instance
staticget

Static singleton of this ScriptableObject.


The documentation for this class was generated from the following file: