Photon Fusion 2.1.1

NetworkObjectTypeId Struct Reference

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

Inherits INetworkStruct.

Classes

class  EqualityComparer
 NetworkObjectTypeId Comparer More...

Public Member Functions

readonly bool Equals (NetworkObjectTypeId other)
 Checks if the current NetworkObjectTypeId instance is equal to another NetworkObjectTypeId instance.
override readonly bool Equals (object obj)
 Determines whether the specified object is equal to the current NetworkObjectTypeId instance.
override readonly int GetHashCode ()
 Generates a hash code for the current NetworkObjectTypeId instance.
override readonly 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 FromSceneObjectId (NetworkSceneObjectId sceneObjectId)
 Creates a NetworkObjectTypeId from a NetworkSceneObjectId.
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.

Properties

readonly uint AsCustom [get]
 Gets the raw uint value representation of the NetworkObjectTypeId assuming it is a Custom type.
readonly ushort AsInternalStructId [get]
 Gets the ushort value representation of the NetworkObjectTypeId assuming it is an InternalStruct type.
readonly NetworkPrefabId AsPrefabId [get]
 Gets the NetworkPrefabId representation of the NetworkObjectTypeId assuming it is a Prefab.
readonly 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.
readonly bool IsCustom [get]
 Checks if the NetworkObjectTypeId is a Custom type.
readonly bool IsNone [get]
 Checks if the NetworkObjectTypeId is invalid.
readonly bool IsPrefab [get]
 Checks if the NetworkObjectTypeId is a Prefab.
readonly bool IsPrefabNestedObject [get]
 Checks if the NetworkObjectTypeId is a Prefab.
readonly bool IsSceneObject [get]
 Checks if the NetworkObjectTypeId is a SceneObject.
readonly bool IsStruct [get]
 Checks if the NetworkObjectTypeId is an InternalStruct.
readonly bool IsValid [get]
 Checks if the NetworkObjectTypeId is valid.
readonly 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]

readonly 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 readonly 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()

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()

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.

◆ FromSceneObjectId()

NetworkObjectTypeId FromSceneObjectId ( NetworkSceneObjectId sceneObjectId)
static

Creates a NetworkObjectTypeId from a NetworkSceneObjectId.

Parameters
sceneObjectId
Returns

◆ FromSceneRefAndObjectIndex()

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()

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()

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

readonly 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

readonly 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

readonly 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

readonly 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.