Skip to main content

Class SceneLoadOperation

Represents an asynchronous scene loading operation that can be used as a coroutine and supports progress and completion callbacks.

public class SceneLoadOperation

Inheritance​

Constructors​

SceneLoadOperation(AssetReference, LoadSceneMode)​

Initializes a new instance of the SceneLoadOperation class to load a scene asynchronously.

public SceneLoadOperation(AssetReference sceneReference, LoadSceneMode loadSceneMode = LoadSceneMode.Single)

Parameters​

NameTypeDescription
sceneReferenceAssetReferenceThe addressable reference to the scene asset.
loadSceneModeLoadSceneModeThe loading mode (Single or Additive).

Properties​

Current​

Gets the current element in the coroutine sequence.

public object Current { get; }

Property Value​

object

IsDone​

Gets a value indicating whether the scene loading operation has completed.

public bool IsDone { get; }

Property Value​

bool

PercentComplete​

Gets the current loading progress value from 0f to 1f.

public float PercentComplete { get; }

Property Value​

float

Result​

Gets the loaded scene instance once the operation is completed.

public SceneInstance Result { get; }

Property Value​

SceneInstance

Methods​

MoveNext()​

Advances the operation to the next frame of the coroutine.

public bool MoveNext()

Returns​

bool — true if the operation should continue; false if it is completed.

Reset()​

Resets the scene load operation and clears its progress.

public void Reset()

OnCompleted​

Occurs when the scene has been fully loaded.

public event Action<SceneLoadOperation> OnCompleted

Event Type​

Action<SceneLoadOperation>

OnProgress​

Occurs during scene loading progress updates.

public event Action<SceneLoadOperation> OnProgress

Event Type​

Action<SceneLoadOperation>

  • Constructors
    • SceneLoadOperation(AssetReference, LoadSceneMode)
  • Properties
    • Current
    • IsDone
    • PercentComplete
    • Result
  • Methods
    • MoveNext()
    • Reset()
    • OnCompleted
    • OnProgress