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
| Name | Type | Description |
|---|---|---|
sceneReference | AssetReference | The addressable reference to the scene asset. |
loadSceneMode | LoadSceneMode | The 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.
OnCompleted
Occurs when the scene has been fully loaded.
public event Action<SceneLoadOperation> OnCompleted