Photon Fusion 2.1.1

NetworkObjectAcquireContext Struct Reference

Represents the context for acquiring a prefab instance for a network object. This struct is unsafe because it uses pointers. More...

Public Member Functions

 NetworkObjectAcquireContext (NetworkObjectTypeId typeId, NetworkObjectMeta meta=null, bool isSynchronous=true, bool dontDestroyOnLoad=false, NetworkObject attachableInstance=null)
 Initializes a new instance of the NetworkPrefabAcquireContext struct with the specified parameters.

Public Attributes

readonly NetworkObject AttachableInstance
 Attachable instance. Usually this is the object previously passed in NetworkRunner.RegisterSceneObjects.
readonly bool DontDestroyOnLoad
 Indicates whether the network object should not be destroyed on load.
readonly bool IsSynchronous
 Indicates whether the operation is synchronous.
readonly NetworkObjectMeta Meta
 The metadata of the network object.
readonly NetworkObjectTypeId TypeId
 The identifier of the prefab.

Properties

ReadOnlySpan< int > Data [get]
 Gets the data pointer to the first word of this NetworkObject's data block.
bool HasHeader [get]
 Checks if the Header is not null.
ref NetworkObjectHeader Header [get]
 Returns the Header if it is not null; otherwise, returns null.
NetworkPrefabIdPrefabId [get]
 Prefab id or null if the type is not a prefab.

Detailed Description

Represents the context for acquiring a prefab instance for a network object. This struct is unsafe because it uses pointers.

Constructor & Destructor Documentation

◆ NetworkObjectAcquireContext()

NetworkObjectAcquireContext ( NetworkObjectTypeId typeId,
NetworkObjectMeta meta = null,
bool isSynchronous = true,
bool dontDestroyOnLoad = false,
NetworkObject attachableInstance = null )

Initializes a new instance of the NetworkPrefabAcquireContext struct with the specified parameters.

Parameters
typeIdThe identifier of the type.
metaThe metadata of the network object.
isSynchronousIndicates whether the operation is synchronous.
dontDestroyOnLoadIndicates whether the network object should not be destroyed on load.
attachableInstanceTODO

Property Documentation

◆ Data

ReadOnlySpan<int> Data
get

Gets the data pointer to the first word of this NetworkObject's data block.

Returns
Data pointer to the first word of this NetworkObject's data block.
Exceptions
InvalidOperationExceptionThrown when the Header is null.

◆ HasHeader

bool HasHeader
get

Checks if the Header is not null.

Returns
True if the Header is not null; otherwise, false.