Photon Fusion 2.0.3

Public Member Functions | Public Attributes | Properties | List of all members
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. More...
 

Public Attributes

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

Properties

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

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

Member Data Documentation

◆ AttachableInstance

readonly NetworkObject AttachableInstance

Attachable instance. Usually this is the object previously passed in NetworkRunner.RegisterSceneObjects

◆ DontDestroyOnLoad

readonly bool DontDestroyOnLoad

Indicates whether the network object should not be destroyed on load.

◆ IsSynchronous

readonly bool IsSynchronous

Indicates whether the operation is synchronous.

◆ Meta

readonly NetworkObjectMeta Meta

The metadata of the network object.

◆ TypeId

readonly NetworkObjectTypeId TypeId

The identifier of the prefab.

Property Documentation

◆ Data

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.

◆ Header

NetworkObjectHeader* Header
get

Returns the Header if it is not null; otherwise, returns null.

◆ PrefabId

NetworkPrefabId? PrefabId
get

Prefab id or null if the type is not a prefab.