API reference
API reference
Select your platform
No SDKs available
No versions available

CustomNetworkObjectProvider Class

Extends NetworkObjectProviderDefault
A custom provider to allow composing NetworkObjects programmatically (instead of placing in-Scene or spawning from Prefabs).
This object should be attached onto a NetworkRunner object. This is a helper component when using the Photon Fusion networking framework.

Methods

AcquirePrefabInstance ( runner , context , result )
Signature
override NetworkObjectAcquireResult AcquirePrefabInstance(NetworkRunner runner, in NetworkPrefabAcquireContext context, out NetworkObject result)
Parameters
runner: NetworkRunner
context: in NetworkPrefabAcquireContext
result: out NetworkObject
Returns
override NetworkObjectAcquireResult

Static Methods

RegisterCustomNetworkObject ( customPrefabID , func )
Register your custom network object spawning function before the object is spawned.
e.g. register in InitializeOnLoad function
Signature
static void RegisterCustomNetworkObject(uint customPrefabID, CustomNetworkObjectSpawnFunc func)
Parameters
customPrefabID: uint  Used to identify the custom object. Should be unique and larger than 100000
func: CustomNetworkObjectSpawnFunc  Function that compose a GameObject (NetworkObject) programmatically
Returns
void