Class NetworkVariable<T>
A variable that can be synchronized over the network.
Implements
Inherited Members
Namespace: Unity.Netcode
Assembly: solution.dll
Syntax
[Serializable]
[GenerateSerializationForGenericParameter(0)]
public class NetworkVariable<T> : NetworkVariableBase, IDisposable
Type Parameters
Name | Description |
---|---|
T | the unmanaged type for NetworkVariable<T> |
Constructors
Name | Description |
---|---|
NetworkVariable(T, NetworkVariableReadPermission, NetworkVariableWritePermission) | Constructor for NetworkVariable<T> |
Fields
Name | Description |
---|---|
OnValueChanged | The callback to be invoked when the value gets changed |
Properties
Name | Description |
---|---|
Value | The value of the NetworkVariable container |
Methods
Name | Description |
---|---|
Dispose() | Virtual IDisposable implementation |
~NetworkVariable() | |
IsDirty() | Gets Whether or not the container is dirty |
ReadDelta(FastBufferReader, bool) | Reads value from the reader and applies it |
ReadField(FastBufferReader) | Reads the complete state from the reader and applies it |
ResetDirty() | Resets the dirty state and marks the variable as synced / clean |
WriteDelta(FastBufferWriter) | Writes the variable to the writer |
WriteField(FastBufferWriter) | Writes the complete state of the variable to the writer |