Class SceneLoadOperation
Handle for a managed scene load or unload started through ScyllaSceneManager. Exposes normalized progress, the current SceneLoadState, an activation gate for loading screens, and completion via Awaitable or the Completed callback.
Inherited Members
Namespace: Scylla.Core.Scenes
Assembly: ScyllaCore.dll
Syntax
public sealed class SceneLoadOperation
Remarks
Progress is normalized to 0-1 where 1.0 means the scene is fully
activated. While the activation gate is closed the operation holds at 0.9
with State equal to
WaitingForActivation, so loading screens can test the
state instead of Unity's raw 0.9 magic number.
Activation gate: operations started with manual activation (see
WithManualActivation()) or a minimum duration
hold at the gate until BOTH AllowActivation is true AND the
minimum duration has elapsed. The gate can only be opened; setting
AllowActivation back to false after activation has started
has no effect.
Completion: Awaitable completes when the operation reaches Completed or Failed; a failure does NOT throw from the await, it surfaces via State and Error. The awaitable is single-consumer: await it from exactly one place, or use Completed for additional listeners (subscribing after completion invokes the handler immediately).
Properties
AllowActivation
Gets or sets the user half of the activation gate. Defaults to true unless
the operation was started with
WithManualActivation(). The scene activates once
this is true AND the operation's minimum duration has elapsed. Setting the
value back to false after activation has begun has no effect.
Declaration
public bool AllowActivation { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Awaitable
Gets an awaitable that completes when the operation reaches a terminal state (Completed or Failed). Single-consumer: await from exactly one place; additional listeners should use Completed.
Declaration
public Awaitable Awaitable { get; }
Property Value
| Type | Description |
|---|---|
| Awaitable |
BuildIndex
Gets the build index this operation targets, or -1 when the load was
requested by name.
Declaration
public int BuildIndex { get; }
Property Value
| Type | Description |
|---|---|
| int |
Error
Declaration
public string Error { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsUnload
Gets whether this operation unloads a scene rather than loading one. Unload
operations skip the activation-gate phase entirely, so
Progress advances straight from 0 to 1 without holding
at 0.9, and Scene stays at its default, invalid value on
completion.
Declaration
public bool IsUnload { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Mode
Gets the Unity load mode requested for this operation: UnityEngine.SceneManagement.LoadSceneMode.Single replaces every currently loaded scene, UnityEngine.SceneManagement.LoadSceneMode.Additive loads alongside them. Meaningless for unloads, which are always constructed with UnityEngine.SceneManagement.LoadSceneMode.Additive regardless of how the unloaded scene was originally loaded.
Declaration
public LoadSceneMode Mode { get; }
Property Value
| Type | Description |
|---|---|
| LoadSceneMode |
Progress
Gets the normalized progress of the operation, updated once per frame while the operation is in flight.
Declaration
public float Progress { get; }
Property Value
| Type | Description |
|---|---|
| float | A value in the range 0-1. Holds at |
Scene
Gets the resulting scene handle.
Declaration
public Scene Scene { get; }
Property Value
| Type | Description |
|---|---|
| Scene | A valid scene once a load operation reaches Completed; the default, invalid value for unloads and for operations that ended in Failed. |
SceneName
Gets the name of the scene this operation targets, or null when the load
was requested by build index.
Declaration
public string SceneName { get; }
Property Value
| Type | Description |
|---|---|
| string |
State
Gets the current lifecycle state of the operation.
Declaration
public SceneLoadState State { get; }
Property Value
| Type | Description |
|---|---|
| SceneLoadState | One of the SceneLoadState values. Starts at NotStarted and advances monotonically to a terminal state (Completed or Failed). |
Events
Completed
Raised once when the operation reaches a terminal state. Subscribing after completion invokes the handler immediately, so late listeners are never lost.
Declaration
public event Action<SceneLoadOperation> Completed
Event Type
| Type | Description |
|---|---|
| Action<SceneLoadOperation> |