Photon Fusion 2.0.0

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
NetworkSceneAsyncOp Struct Reference

A wrapper for async scene operations. More...

Inherits IEnumerator.

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.
 
bool IEnumerator. MoveNext ()
 
void IEnumerator. Reset ()
 

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

object IEnumerator. Current [get]
 
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()

static 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()

static NetworkSceneAsyncOp FromCompleted ( SceneRef  sceneRef)
static

Creates a completed NetworkSceneAsyncOp

Parameters
sceneRefScene reference
Returns
Returns a NetworkSceneAsyncOp instance

◆ FromCoroutine()

static 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()

static 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()

static 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