Photon Fusion 2.0.4

Public Member Functions | List of all members
INetworkObjectProvider Interface Reference

Interface which defines the handlers for NetworkRunner Spawn() and Despawn() actions. Passing an instance of this interface to NetworkRunner.StartGame(StartGameArgs) as the StartGameArgs.ObjectProvider argument value will assign that instance as the handler for runner Spawn() and Despawn() actions. By default (if StartGameArgs.ObjectProvider == null) actions will use Instantiate(), and Despawn() actions will use Destroy(). More...

Inherited by NetworkObjectProviderDummy.

Public Member Functions

NetworkObjectAcquireResult AcquirePrefabInstance (NetworkRunner runner, in NetworkPrefabAcquireContext context, out NetworkObject result)
 Acquires an instance of a prefab for a network object. More...
 
NetworkPrefabId GetPrefabId (NetworkRunner runner, NetworkObjectGuid prefabGuid)
 Translates guid into prefab id. More...
 
void Initialize (NetworkRunner networkRunner)
 
void ReleaseInstance (NetworkRunner runner, in NetworkObjectReleaseContext context)
 Releases an instance of a network object. More...
 
void Shutdown (NetworkRunner networkRunner)
 

Detailed Description

Interface which defines the handlers for NetworkRunner Spawn() and Despawn() actions. Passing an instance of this interface to NetworkRunner.StartGame(StartGameArgs) as the StartGameArgs.ObjectProvider argument value will assign that instance as the handler for runner Spawn() and Despawn() actions. By default (if StartGameArgs.ObjectProvider == null) actions will use Instantiate(), and Despawn() actions will use Destroy().

Member Function Documentation

◆ AcquirePrefabInstance()

NetworkObjectAcquireResult AcquirePrefabInstance ( NetworkRunner  runner,
in NetworkPrefabAcquireContext  context,
out NetworkObject  result 
)

Acquires an instance of a prefab for a network object.

Parameters
runnerThe NetworkRunner that manages the network objects.
contextThe context that provides information for acquiring the prefab instance.
resultThe acquired NetworkObject instance.
Returns
A NetworkObjectAcquireResult indicating the result of the operation.

Implemented in NetworkObjectProviderDummy.

◆ GetPrefabId()

NetworkPrefabId GetPrefabId ( NetworkRunner  runner,
NetworkObjectGuid  prefabGuid 
)

Translates guid into prefab id.

Parameters
runner
prefabGuid
Returns

Implemented in NetworkObjectProviderDummy.

◆ Initialize()

void Initialize ( NetworkRunner  networkRunner)

Parameters
networkRunner

◆ ReleaseInstance()

void ReleaseInstance ( NetworkRunner  runner,
in NetworkObjectReleaseContext  context 
)

Releases an instance of a network object.

Parameters
runnerThe NetworkRunner that manages the network objects.
contextThe context that provides information for releasing the network object instance.

Implemented in NetworkObjectProviderDummy.

◆ Shutdown()

void Shutdown ( NetworkRunner  networkRunner)

Parameters
networkRunner