Struct NetworkBehaviourRef<T>
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
TThe type of NetworkBehaviour being referenced.
- Implements
- Inherited Members
Constructors
NetworkBehaviourRef(NetworkBehaviour)
public NetworkBehaviourRef(NetworkBehaviour beh)
Parameters
behNetworkBehaviour
Fields
BehaviourId
public readonly int BehaviourId
Field Value
ObjectId
public readonly int ObjectId
Field Value
Properties
IsValid
public bool IsValid { get; }
Property Value
Methods
Equals(NetworkBehaviourRef<T>)
public bool Equals(NetworkBehaviourRef<T> other)
Parameters
otherNetworkBehaviourRef<T>
Returns
Equals(object)
public override bool Equals(object other)
Parameters
otherobject
Returns
GetBehaviour(NetworkSandbox)
public T GetBehaviour(NetworkSandbox sandbox)
Parameters
sandboxNetworkSandbox
Returns
- T
GetBehaviour<T>(NetworkSandbox)
public T GetBehaviour<T>(NetworkSandbox sandbox) where T : NetworkBehaviour
Parameters
sandboxNetworkSandbox
Returns
- T
Type Parameters
T
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
TryGetBehaviour(NetworkSandbox, out T)
public bool TryGetBehaviour(NetworkSandbox sandbox, out T behaviour)
Parameters
sandboxNetworkSandboxbehaviourT
Returns
Operators
operator ==(NetworkBehaviourRef<T>, NetworkBehaviourRef<T>)
public static bool operator ==(NetworkBehaviourRef<T> a, NetworkBehaviourRef<T> b)
Parameters
aNetworkBehaviourRef<T>bNetworkBehaviourRef<T>
Returns
operator !=(NetworkBehaviourRef<T>, NetworkBehaviourRef<T>)
public static bool operator !=(NetworkBehaviourRef<T> a, NetworkBehaviourRef<T> b)
Parameters
aNetworkBehaviourRef<T>bNetworkBehaviourRef<T>