Photon Fusion 2.1.1

NetworkSceneAsyncOp Struct Reference

A wrapper for async scene operations. More...

Classes

struct  Awaiter
 Awaiter for NetworkSceneAsyncOp. More...

Public Member Functions

void AddOnCompleted (Action< NetworkSceneAsyncOp > action)
 Adds a callback to be called when the operation is completed.
Awaiter GetAwaiter ()
 Gets the awaiter for the operation.

Static Public Member Functions

static NetworkSceneAsyncOp FromAsyncOperation (SceneRef sceneRef, UnityEngine.AsyncOperation asyncOp)
 Creates a NetworkSceneAsyncOp from a UnityEngine.AsyncOperation.
static NetworkSceneAsyncOp FromCompleted (SceneRef sceneRef)
 Creates a completed NetworkSceneAsyncOp.
static NetworkSceneAsyncOp FromCoroutine (SceneRef sceneRef, ICoroutine coroutine)
 Creates a NetworkSceneAsyncOp from a ICoroutine.
static NetworkSceneAsyncOp FromError (SceneRef sceneRef, Exception error)
 Creates a NetworkSceneAsyncOp from a Exception.
static NetworkSceneAsyncOp FromTask (SceneRef sceneRef, Task task)
 Creates a NetworkSceneAsyncOp from a Task.

Public Attributes

readonly SceneRef SceneRef
 The scene reference of the operation.

Properties

Exception Error [get]
 Attached error to the operation.
bool IsDone [get]
 Signals if the operation is done.
bool IsValid [get]
 Signals if the operation is valid.

Detailed Description

A wrapper for async scene operations.

Member Function Documentation

◆ AddOnCompleted()

void AddOnCompleted ( Action< NetworkSceneAsyncOp > action)

Adds a callback to be called when the operation is completed.

Parameters
actionThe callback to be called

◆ FromAsyncOperation()

NetworkSceneAsyncOp FromAsyncOperation ( SceneRef sceneRef,
UnityEngine.AsyncOperation asyncOp )
static

Creates a NetworkSceneAsyncOp from a UnityEngine.AsyncOperation.

Parameters
sceneRefScene reference
asyncOpAsync operation reference
Returns
Returns a NetworkSceneAsyncOp instance
Exceptions
ArgumentNullExceptionThrown if asyncOp is null

◆ FromCompleted()

NetworkSceneAsyncOp FromCompleted ( SceneRef sceneRef)
static

Creates a completed NetworkSceneAsyncOp.

Parameters
sceneRefScene reference
Returns
Returns a NetworkSceneAsyncOp instance

◆ FromCoroutine()

NetworkSceneAsyncOp FromCoroutine ( SceneRef sceneRef,
ICoroutine coroutine )
static

Creates a NetworkSceneAsyncOp from a ICoroutine.

Parameters
sceneRefScene reference
coroutineCoroutine reference
Returns
Returns a NetworkSceneAsyncOp instance
Exceptions
ArgumentNullExceptionThrown if coroutine is null

◆ FromError()

NetworkSceneAsyncOp FromError ( SceneRef sceneRef,
Exception error )
static

Creates a NetworkSceneAsyncOp from a Exception.

Parameters
sceneRefScene reference
errorException reference
Returns
Returns a NetworkSceneAsyncOp instance
Exceptions
ArgumentNullExceptionThrown if error is null

◆ FromTask()

NetworkSceneAsyncOp FromTask ( SceneRef sceneRef,
Task task )
static

Creates a NetworkSceneAsyncOp from a Task.

Parameters
sceneRefScene reference
taskTask reference
Returns
Returns a NetworkSceneAsyncOp instance
Exceptions
ArgumentNullExceptionThrown if task is null