Class SceneDirector
Loads and unloads scenes and has callbacks for when the active scene changed, a scene was loaded and a scene was unloaded.
Inherited Members
Namespace: Doozy.Runtime.SceneManagement
Assembly: cs.temp.dll.dll
Syntax
public class SceneDirector : SingletonBehaviour<SceneDirector>
Fields
DebugMode
Enable relevant debug messages to be printed to the console
Declaration
public bool DebugMode
Field Value
Type | Description |
---|---|
Boolean |
k_StreamCategory
Stream category name
Declaration
public const string k_StreamCategory = "SceneManagement"
Field Value
Type | Description |
---|---|
String |
k_StreamName
Declaration
public const string k_StreamName = "SceneDirector"
Field Value
Type | Description |
---|---|
String |
Properties
debug
Debug flag
Declaration
public bool debug { get; }
Property Value
Type | Description |
---|---|
Boolean |
onActiveSceneChanged
UnityEvent executed when the active Scene has changed
Declaration
public ActiveSceneChangedEvent onActiveSceneChanged { get; }
Property Value
Type | Description |
---|---|
ActiveSceneChangedEvent |
onSceneLoaded
UnityEvent executed when a Scene has loaded
Declaration
public SceneLoadedEvent onSceneLoaded { get; }
Property Value
Type | Description |
---|---|
SceneLoadedEvent |
onSceneUnloaded
UnityEvent executed when a Scene has unloaded
Declaration
public SceneUnloadedEvent onSceneUnloaded { get; }
Property Value
Type | Description |
---|---|
SceneUnloadedEvent |
settings
Reference to the SceneManagement global settings
Declaration
public static SceneManagementSettings settings { get; }
Property Value
Type | Description |
---|---|
SceneManagementSettings |
stream
Signal stream for this component type
Declaration
public static SignalStream stream { get; }
Property Value
Type | Description |
---|---|
SignalStream |
Methods
AddToScene(Boolean)
Adds SceneDirector to scene and returns a reference to it
Declaration
public static SceneDirector AddToScene(bool selectGameObjectAfterCreation = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | selectGameObjectAfterCreation |
Returns
Type | Description |
---|---|
SceneDirector |
Awake()
Declaration
protected override void Awake()
Overrides
LoadSceneAsync(Scene, LoadSceneMode)
Create a SceneLoader that loads the given Scene asynchronously in the background, then returns a reference to the newly created SceneLoader
Declaration
public static SceneLoader LoadSceneAsync(Scene scene, LoadSceneMode loadSceneMode)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | Scene to load |
LoadSceneMode | loadSceneMode | If LoadSceneMode.Single then all current Scenes will be unloaded before loading |
Returns
Type | Description |
---|---|
SceneLoader |
LoadSceneAsync(Int32, LoadSceneMode)
Create a SceneLoader that loads the Scene asynchronously in the background by its index in Build Settings, then returns a reference to the newly created SceneLoader
Declaration
public static SceneLoader LoadSceneAsync(int sceneBuildIndex, LoadSceneMode loadSceneMode)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sceneBuildIndex | Index of the Scene in the Build Settings to load |
LoadSceneMode | loadSceneMode | If LoadSceneMode.Single then all current Scenes will be unloaded before loading |
Returns
Type | Description |
---|---|
SceneLoader |
LoadSceneAsync(String, LoadSceneMode)
Create a SceneLoader that loads the Scene asynchronously in the background by its name in Build Settings, then returns a reference to the newly created SceneLoader
Declaration
public static SceneLoader LoadSceneAsync(string sceneName, LoadSceneMode loadSceneMode)
Parameters
Type | Name | Description |
---|---|---|
String | sceneName | Name or path of the Scene to load |
LoadSceneMode | loadSceneMode | If LoadSceneMode.Single then all current Scenes will be unloaded before loading |
Returns
Type | Description |
---|---|
SceneLoader |
OnDestroy()
Declaration
protected override void OnDestroy()
Overrides
UnloadSceneAsync(Scene)
Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager
Declaration
public static AsyncOperation UnloadSceneAsync(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | Scene to unload. |
Returns
Type | Description |
---|---|
AsyncOperation |
UnloadSceneAsync(Int32)
Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager
Declaration
public static AsyncOperation UnloadSceneAsync(int sceneBuildIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sceneBuildIndex | Index of the Scene in BuildSettings |
Returns
Type | Description |
---|---|
AsyncOperation |
UnloadSceneAsync(String)
Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager
Declaration
public static AsyncOperation UnloadSceneAsync(string sceneName)
Parameters
Type | Name | Description |
---|---|---|
String | sceneName | Name or path of the Scene to unload. |
Returns
Type | Description |
---|---|
AsyncOperation |