Photon Fusion 2.0.0

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

ID for a NetworkObject Prefab which has been cataloged in a NetworkProjectConfig.PrefabTable. More...

Inherits INetworkStruct, and IEquatable< NetworkObjectTypeId >.

Classes

class  EqualityComparer
 NetworkObjectTypeId Comparer More...
 

Public Member Functions

bool Equals (NetworkObjectTypeId other)
 Checks if the current NetworkObjectTypeId instance is equal to another NetworkObjectTypeId instance.
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current NetworkObjectTypeId instance.
 
override int GetHashCode ()
 Generates a hash code for the current NetworkObjectTypeId instance.
 
override string ToString ()
 Returns a string that represents the current NetworkObjectTypeId instance.
 

Static Public Member Functions

static NetworkObjectTypeId FromCustom (uint raw)
 Creates a NetworkObjectTypeId from a raw uint value representing a Custom type.
 
static NetworkObjectTypeId FromPrefabId (NetworkPrefabId prefabId)
 Creates a NetworkObjectTypeId from a NetworkPrefabId.
 
static NetworkObjectTypeId FromSceneRefAndObjectIndex (SceneRef sceneRef, int objIndex, NetworkSceneLoadId loadId=default)
 Creates a NetworkObjectTypeId from a SceneRef, an object index, and an optional NetworkSceneLoadId.
 
static NetworkObjectTypeId FromStruct (ushort structId)
 Creates a NetworkObjectTypeId from a ushort value representing an InternalStruct type.
 
static implicit operator NetworkObjectTypeId (NetworkPrefabId prefabId)
 Converts a NetworkPrefabId instance to a NetworkObjectTypeId instance.
 
static bool operator!= (NetworkObjectTypeId a, NetworkObjectTypeId b)
 Determines whether two NetworkObjectTypeId instances are not equal.
 
static bool operator== (NetworkObjectTypeId a, NetworkObjectTypeId b)
 Determines whether two NetworkObjectTypeId instances are equal.
 

Public Attributes

uint _value0
 Represents the first part of the value of a NetworkObjectTypeId.
 
uint _value1
 Represents the second part of the value of a NetworkObjectTypeId.
 

Static Public Attributes

const int ALIGNMENT = 4
 Represents the alignment of a NetworkObjectTypeId in memory.
 
const int MAX_SCENE_OBJECT_INDEX = (1 << SCENE_OBJECT_INDEX_BITS) - 1
 Represents the maximum number of SceneObjects that can be represented by a NetworkObjectTypeId.
 
const int SIZE = 8
 Represents the size of a NetworkObjectTypeId in bytes.
 
const ushort STRUCT_TYPE_PLAYERDATA = 1
 

Properties

uint AsCustom [get]
 Gets the raw uint value representation of the NetworkObjectTypeId assuming it is a Custom type.
 
ushort AsInternalStructId [get]
 Gets the ushort value representation of the NetworkObjectTypeId assuming it is an InternalStruct type.
 
NetworkPrefabId AsPrefabId [get]
 Gets the NetworkPrefabId representation of the NetworkObjectTypeId assuming it is a Prefab.
 
NetworkSceneObjectId AsSceneObjectId [get]
 Gets the NetworkSceneObjectId representation of the NetworkObjectTypeId assuming it is a SceneObject.
 
static EqualityComparer Comparer = new EqualityComparer() [get]
 An instance of the NetworkObjectTypeId EqualityComparer class.
 
bool IsCustom [get]
 Checks if the NetworkObjectTypeId is a Custom type.
 
bool IsNone [get]
 Checks if the NetworkObjectTypeId is invalid.
 
bool IsPrefab [get]
 Checks if the NetworkObjectTypeId is a Prefab.
 
bool IsSceneObject [get]
 Checks if the NetworkObjectTypeId is a SceneObject.
 
bool IsStruct [get]
 Checks if the NetworkObjectTypeId is an InternalStruct.
 
bool IsValid [get]
 Checks if the NetworkObjectTypeId is valid.
 
NetworkTypeIdKind Kind [get]
 Gets the kind of the NetworkObjectTypeId.
 
static NetworkObjectTypeId PlayerData [get]
 Represents a NetworkObjectTypeId for the PlayerData.
 

Detailed Description

ID for a NetworkObject Prefab which has been cataloged in a NetworkProjectConfig.PrefabTable.

Member Function Documentation

◆ Equals() [1/2]

bool Equals ( NetworkObjectTypeId  other)

Checks if the current NetworkObjectTypeId instance is equal to another NetworkObjectTypeId instance.

Parameters
otherThe other NetworkObjectTypeId instance to compare with the current instance.

◆ Equals() [2/2]

override bool Equals ( object  obj)

Determines whether the specified object is equal to the current NetworkObjectTypeId instance.

Parameters
objThe object to compare with the current NetworkObjectTypeId instance.

◆ FromCustom()

static NetworkObjectTypeId FromCustom ( uint  raw)
static

Creates a NetworkObjectTypeId from a raw uint value representing a Custom type.

Parameters
rawThe raw uint value to use.
Returns
A NetworkObjectTypeId that represents a Custom type with the given raw value.

◆ FromPrefabId()

static NetworkObjectTypeId FromPrefabId ( NetworkPrefabId  prefabId)
static

Creates a NetworkObjectTypeId from a NetworkPrefabId.

Parameters
prefabIdThe NetworkPrefabId to use.
Returns
A NetworkObjectTypeId that represents a Prefab with the given NetworkPrefabId.
Exceptions
ArgumentExceptionThrown when the provided NetworkPrefabId is not valid.

◆ FromSceneRefAndObjectIndex()

static NetworkObjectTypeId FromSceneRefAndObjectIndex ( SceneRef  sceneRef,
int  objIndex,
NetworkSceneLoadId  loadId = default 
)
static

Creates a NetworkObjectTypeId from a SceneRef, an object index, and an optional NetworkSceneLoadId.

Parameters
sceneRefThe SceneRef to use.
objIndexThe object index to use.
loadIdThe NetworkSceneLoadId to use. Defaults to default(NetworkSceneLoadId).
Returns
A NetworkObjectTypeId that represents a SceneObject with the given SceneRef, object index, and NetworkSceneLoadId.
Exceptions
ArgumentExceptionThrown when the provided SceneRef is not valid.
ArgumentOutOfRangeExceptionThrown when the provided object index is out of range.

◆ FromStruct()

static NetworkObjectTypeId FromStruct ( ushort  structId)
static

Creates a NetworkObjectTypeId from a ushort value representing an InternalStruct type.

Parameters
structIdThe ushort value to use.
Returns
A NetworkObjectTypeId that represents an InternalStruct type with the given ushort value.

◆ operator NetworkObjectTypeId()

static implicit operator NetworkObjectTypeId ( NetworkPrefabId  prefabId)
static

Converts a NetworkPrefabId instance to a NetworkObjectTypeId instance.

Parameters
prefabIdThe NetworkPrefabId instance to convert.
Returns
A NetworkObjectTypeId instance that represents a Prefab with the given NetworkPrefabId.

Property Documentation

◆ AsCustom

uint AsCustom
get

Gets the raw uint value representation of the NetworkObjectTypeId assuming it is a Custom type.

The raw uint value representation of the NetworkObjectTypeId.

Exceptions
InvalidOperationExceptionThrown when the NetworkObjectTypeId is not a Custom type.

◆ AsInternalStructId

ushort AsInternalStructId
get

Gets the ushort value representation of the NetworkObjectTypeId assuming it is an InternalStruct type.

The ushort value representation of the NetworkObjectTypeId.

Exceptions
InvalidOperationExceptionThrown when the NetworkObjectTypeId is not an InternalStruct type.

◆ AsPrefabId

NetworkPrefabId AsPrefabId
get

Gets the NetworkPrefabId representation of the NetworkObjectTypeId assuming it is a Prefab.

The NetworkPrefabId representation of the NetworkObjectTypeId.

Exceptions
InvalidOperationExceptionThrown when the NetworkObjectTypeId is not a Prefab.

◆ AsSceneObjectId

NetworkSceneObjectId AsSceneObjectId
get

Gets the NetworkSceneObjectId representation of the NetworkObjectTypeId assuming it is a SceneObject.

The NetworkSceneObjectId representation of the NetworkObjectTypeId.

Exceptions
InvalidOperationExceptionThrown when the NetworkObjectTypeId is not a SceneObject.