Class ScyllaActiveSceneChangedEvent
Published by ScyllaSceneManager when a managed load operation changes Unity's active scene: unconditionally after a UnityEngine.SceneManagement.LoadSceneMode.Single load (the loaded scene always becomes active), or after an additive load whose caller requested active-scene assignment. It is the last event a managed load operation publishes.
Inherited Members
Namespace: Scylla.Core.Scenes
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaActiveSceneChangedEvent : ScyllaEvent
Remarks
Published once per completed load operation, and only when the active scene actually changed; a load that does not change the active scene (most additive loads) publishes no instance of this event. When it does fire, it does so after ScyllaSceneUnloadedEvent (for any scenes the load replaced) and after ScyllaSceneLoadedEvent for the newly loaded scene, and before the manager's registered post-load tasks run.
The active scene owns lighting and skybox settings and is where new objects are
instantiated by default, so systems that cache per-scene environment state should
refresh on this event. The PreviousScene handle may already be
invalid when the change was caused by a single-mode load that destroyed it; always
validate a scene handle with Scene.IsValid() before querying it.
Like every ScyllaEvent, a handler can call StopPropagation() to keep lower-priority subscribers of this same event from receiving it. ScyllaSceneManager never reads IsCancelled after publishing it; the active-scene change has already taken effect by the time this event fires, so there is nothing left to cancel.
Constructors
ScyllaActiveSceneChangedEvent(Scene, Scene)
Initializes a new ScyllaActiveSceneChangedEvent.
Declaration
public ScyllaActiveSceneChangedEvent(Scene previousScene, Scene newScene)
Parameters
| Type | Name | Description |
|---|---|---|
| Scene | previousScene | The previously active scene (may be invalid if destroyed). |
| Scene | newScene | The newly active scene. |
Properties
NewScene
Gets the handle of the newly active scene.
Declaration
public Scene NewScene { get; }
Property Value
| Type | Description |
|---|---|
| Scene | A valid UnityEngine.SceneManagement.Scene handle for the scene that is now active. |
PreviousScene
Gets the handle of the previously active scene. May be invalid when that scene was destroyed by the operation that caused the change.
Declaration
public Scene PreviousScene { get; }
Property Value
| Type | Description |
|---|---|
| Scene | The UnityEngine.SceneManagement.Scene that was active before this
change. Check |