The main class used for loading, unloading, and reloading Scenes.
More...
|
| void | LoadScene (string sceneName, bool allowSceneActivation=true, bool setActiveScene=false) |
| | Load a single scene by name additively and asynchronously.
|
| void | LoadScenes (string[] sceneNames, bool allowSceneActivation=true, int indexSetActiveScene=-1) |
| | Load an array of scenes by name additively and asynchronously.
|
| void | LoadScenes (List< AdditiveScene > additiveScenes, bool allowSceneActivation=true, int indexSetActiveScene=-1) |
| | Load a list of AdditiveScenes additively and asynchronously.
|
| void | UnloadScene (string sceneName) |
| | Unload a single scene by name.
|
| void | UnloadScenes (string[] sceneNames) |
| | Unload an array of scenes by name.
|
| void | UnloadAllScenes () |
| | Unload all currently loaded scenes.
|
| void | UnloadAllScenesExcept (string exception) |
| | Unload all scenes except a single scene.
|
| void | UnloadAllScenesExcept (string[] exceptions) |
| | Unload all scenes except an array of scenes.
|
| void | UnloadAllScenesExcept (List< AdditiveScene > exceptions) |
| | Unload all scenes except a list of AdditiveScenes.
|
| void | ReloadScene (string sceneName) |
| | Reload a single scene.
|
| void | ReloadScenes (string[] sceneNames) |
| | Reloads an array of scenes.
|
| void | ActivateScene (string sceneName) |
| | Complete the loading process on a single scene by name.
|
| void | ActivateScene (AdditiveScene additiveScene) |
| | Complete the loading process on a single scene.
|
| void | ShowInGameUI (bool show) |
| | Use this function to spawn or destroy the In-Game UI.
|
|
| ThreadPriority | threadPriority = ThreadPriority.Low |
| | The ThreadPriority which will be assigned to Application.backgroundLoadingPriority.
|
| bool | bShowInGameUI |
| | Show the In-Game Scene Controller UI.
|
| Dictionary< string, AsyncOperation > | asyncOperations = new() |
| | The AsyncOperation for loading a level is saved into a dictionary where string is the Scene Name.
|
|
| async void | LoadSceneAsync (string sceneName, bool allowSceneActivation=true, bool setActiveScene=false) |
| | The internal Task responsibe for loading scenes.
|
| async void | UnloadSceneAsync (string sceneName) |
| | The internal Task responsibe for unloading scenes.
|
| async void | ReloadSceneAsync (string sceneName) |
| | The internal Task responsibe for reloading scenes.
|
| IEnumerator | IActivateScene (AdditiveScene additiveScene) |
| | The internal Coroutine responsibe for activating scenes.
|
| VisualElement | CreateLoadedSceneListBox () |
| | Creates the In-Game UI Elements.
|
| void | OnSceneButtonClick (ClickEvent evt) |
| | Event is called when clicking on the small button next to a Scene on the In-Game UI.
|
The main class used for loading, unloading, and reloading Scenes.
A singleton of this class exists at SceneController.Instance.
◆ ActivateScene() [1/2]
Complete the loading process on a single scene.
Sets the 'allowSceneActivation' bool to true, advancing a scene's loading progress from 0.9 to 1. This does not make it the "Active Scene". It only "activates" the scene, making it visible and triggering the Awake, OnEnable, and Start functions.
- Parameters
-
◆ ActivateScene() [2/2]
| void ActivateScene |
( |
string | sceneName | ) |
|
Complete the loading process on a single scene by name.
Sets the 'allowSceneActivation' bool to true, advancing a scene's loading progress from 0.9 to 1. This does not make it the "Active Scene". It only "activates" the scene, making it visible and triggering the Awake, OnEnable, and Start functions.
- Parameters
-
| sceneName | The unique name of the scene to activate. |
◆ CreateLoadedSceneListBox()
| VisualElement CreateLoadedSceneListBox |
( |
| ) |
|
|
private |
Creates the In-Game UI Elements.
- Returns
- The VisualElement that holds the entire In-Game UI.
◆ IActivateScene()
The internal Coroutine responsibe for activating scenes.
- Parameters
-
◆ LoadScene()
| void LoadScene |
( |
string | sceneName, |
|
|
bool | allowSceneActivation = true, |
|
|
bool | setActiveScene = false ) |
Load a single scene by name additively and asynchronously.
- Parameters
-
| sceneName | The unique name of the scene to load. |
| allowSceneActivation | If true, the scene will automatically activate when it has finished loading. |
| setActiveScene | If true, the scene will become the Active Scene when it has finished loading. |
◆ LoadSceneAsync()
| async void LoadSceneAsync |
( |
string | sceneName, |
|
|
bool | allowSceneActivation = true, |
|
|
bool | setActiveScene = false ) |
|
private |
The internal Task responsibe for loading scenes.
- Parameters
-
| sceneName | The unique name of the scene to load. |
| allowSceneActivation | If true, the scene will automatically activate when it has finished loading. |
| setActiveScene | If true, the scene will become the Active Scene when it has finished loading. |
◆ LoadScenes() [1/2]
| void LoadScenes |
( |
List< AdditiveScene > | additiveScenes, |
|
|
bool | allowSceneActivation = true, |
|
|
int | indexSetActiveScene = -1 ) |
Load a list of AdditiveScenes additively and asynchronously.
- Parameters
-
| additiveScenes | The list of AdditiveScenes to load. |
| allowSceneActivation | If true, all scenes will automatically activate when they have finished loading. |
| indexSetActiveScene | Array index of the scene will become the Active Scene when it has finished loading: -1 = Don't change Active Scene. |
◆ LoadScenes() [2/2]
| void LoadScenes |
( |
string[] | sceneNames, |
|
|
bool | allowSceneActivation = true, |
|
|
int | indexSetActiveScene = -1 ) |
Load an array of scenes by name additively and asynchronously.
- Parameters
-
| sceneNames | The array of unique scene names to load. |
| allowSceneActivation | If true, all scenes will automatically activate when they have finished loading. |
| indexSetActiveScene | Array index of the scene will become the Active Scene when it has finished loading: -1 = Don't change Active Scene. |
◆ OnSceneButtonClick()
| void OnSceneButtonClick |
( |
ClickEvent | evt | ) |
|
|
private |
Event is called when clicking on the small button next to a Scene on the In-Game UI.
◆ ReloadScene()
| void ReloadScene |
( |
string | sceneName | ) |
|
Reload a single scene.
Persistent Scenes will not be reloaded.
- Parameters
-
| sceneName | The unique name of the scene to reload. |
◆ ReloadSceneAsync()
| async void ReloadSceneAsync |
( |
string | sceneName | ) |
|
|
private |
The internal Task responsibe for reloading scenes.
- Parameters
-
| sceneName | The unique name of a single scene to reload. |
◆ ReloadScenes()
| void ReloadScenes |
( |
string[] | sceneNames | ) |
|
Reloads an array of scenes.
Persistent scenes will not be reloaded.
- Parameters
-
◆ ShowInGameUI()
| void ShowInGameUI |
( |
bool | show | ) |
|
Use this function to spawn or destroy the In-Game UI.
- Parameters
-
| show | True = UI is created. False = UI is destroyed. |
◆ UnloadAllScenes()
Unload all currently loaded scenes.
Persistent Scenes will not be unloaded.
◆ UnloadAllScenesExcept() [1/3]
Unload all scenes except a list of AdditiveScenes.
Persistent Scenes will not be unloaded.
- Parameters
-
| exceptions | A list of AdditiveScenes which will not be unloaded. |
◆ UnloadAllScenesExcept() [2/3]
| void UnloadAllScenesExcept |
( |
string | exception | ) |
|
Unload all scenes except a single scene.
Persistent Scenes will not be unloaded.
- Parameters
-
| exception | The scene name which will not be unloaded. |
◆ UnloadAllScenesExcept() [3/3]
| void UnloadAllScenesExcept |
( |
string[] | exceptions | ) |
|
Unload all scenes except an array of scenes.
Persistent Scenes will not be unloaded.
- Parameters
-
| exceptions | An array of scene names which will not be unloaded. |
◆ UnloadScene()
| void UnloadScene |
( |
string | sceneName | ) |
|
Unload a single scene by name.
Persistent Scenes will not be unloaded.
- Parameters
-
| sceneName | The unique name of the scene to unload. |
◆ UnloadSceneAsync()
| async void UnloadSceneAsync |
( |
string | sceneName | ) |
|
|
private |
The internal Task responsibe for unloading scenes.
- Parameters
-
| sceneName | The unique name of the scene to unload. |
◆ UnloadScenes()
| void UnloadScenes |
( |
string[] | sceneNames | ) |
|
Unload an array of scenes by name.
Persistent Scenes will not be unloaded.
- Parameters
-
| sceneNames | The array of unique scene names to unload. |
◆ asyncOperations
| Dictionary<string, AsyncOperation> asyncOperations = new() |
The AsyncOperation for loading a level is saved into a dictionary where string is the Scene Name.
◆ bShowInGameUI
Show the In-Game Scene Controller UI.
◆ Instance
Static singleton of this class.
◆ listViewLoadedScenes
| ListView listViewLoadedScenes |
|
private |
A ListView to display all of the Loaded Scenes on the In-Game UI.
◆ threadPriority
The ThreadPriority which will be assigned to Application.backgroundLoadingPriority.
The documentation for this class was generated from the following file:
- U:/UnityProjects/AdditiveSceneManager/Assets/AdditiveSceneManager/Scripts/SceneController/SceneController.cs