Table of Contents

Struct NetworkBehaviourRef<T>

Namespace
Netick.Unity
Assembly
Netick.Unity.dll

Represents a network-serializable reference to a NetworkBehaviour of type T within the networked simulation. This struct stores the object and behaviour ids, allowing retrieval of the referenced behaviour from a NetworkSandbox.

public struct NetworkBehaviourRef<T> : IEquatable<NetworkBehaviourRef<T>> where T : NetworkBehaviour

Type Parameters

T

The type of NetworkBehaviour being referenced.

Implements
Inherited Members

Constructors

NetworkBehaviourRef(NetworkBehaviour)

public NetworkBehaviourRef(NetworkBehaviour beh)

Parameters

beh NetworkBehaviour

Fields

BehaviourId

public readonly int BehaviourId

Field Value

int

ObjectId

public readonly int ObjectId

Field Value

int

Properties

IsValid

public bool IsValid { get; }

Property Value

bool

Methods

Equals(NetworkBehaviourRef<T>)

public bool Equals(NetworkBehaviourRef<T> other)

Parameters

other NetworkBehaviourRef<T>

Returns

bool

Equals(object)

public override bool Equals(object other)

Parameters

other object

Returns

bool

GetBehaviour(NetworkSandbox)

public T GetBehaviour(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

Returns

T

GetBehaviour<T>(NetworkSandbox)

public T GetBehaviour<T>(NetworkSandbox sandbox) where T : NetworkBehaviour

Parameters

sandbox NetworkSandbox

Returns

T

Type Parameters

T

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

TryGetBehaviour(NetworkSandbox, out T)

public bool TryGetBehaviour(NetworkSandbox sandbox, out T behaviour)

Parameters

sandbox NetworkSandbox
behaviour T

Returns

bool

Operators

operator ==(NetworkBehaviourRef<T>, NetworkBehaviourRef<T>)

public static bool operator ==(NetworkBehaviourRef<T> a, NetworkBehaviourRef<T> b)

Parameters

a NetworkBehaviourRef<T>
b NetworkBehaviourRef<T>

Returns

bool

operator !=(NetworkBehaviourRef<T>, NetworkBehaviourRef<T>)

public static bool operator !=(NetworkBehaviourRef<T> a, NetworkBehaviourRef<T> b)

Parameters

a NetworkBehaviourRef<T>
b NetworkBehaviourRef<T>

Returns

bool