Struct NetworkBehaviourReference
A helper struct for serializing NetworkBehaviours over the network. Can be used in RPCs and NetworkVariable<T>. Note: network ids get recycled by the NetworkManager after a while. So a reference pointing to
Inherited Members
Namespace: Unity.Netcode
Assembly: solution.dll
Syntax
public struct NetworkBehaviourReference : INetworkSerializable, IEquatable<NetworkBehaviourReference>
Constructors
Name | Description |
---|---|
NetworkBehaviourReference(NetworkBehaviour) | Creates a new instance of the NetworkBehaviourReference<T> struct. |
Methods
Name | Description |
---|---|
Equals(object) | Indicates whether this instance and a specified object are equal. |
Equals(NetworkBehaviourReference) | Indicates whether the current object is equal to another object of the same type. |
GetHashCode() | Returns the hash code for this instance. |
NetworkSerialize<T>(BufferSerializer<T>) | Provides bi-directional serialization to read and write the desired data to serialize this type. |
TryGet(out NetworkBehaviour, NetworkManager) | Tries to get the NetworkBehaviour referenced by this reference. |
TryGet<T>(out T, NetworkManager) | Tries to get the NetworkBehaviour referenced by this reference. |
Operators
Name | Description |
---|---|
implicit operator NetworkBehaviourReference(NetworkBehaviour) | Implicitly convert NetworkBehaviour to NetworkBehaviourReference. |
implicit operator NetworkBehaviour(NetworkBehaviourReference) | Implicitly convert NetworkBehaviourReference to NetworkBehaviour. |