Class NetworkVariable\<T\>
A variable that can be synchronized over the network.
#
InheritanceSystem.Object
NetworkVariableBase
NetworkVariable\<T>
#
ImplementsSystem.IDisposable
#
Inherited MembersNetworkVariableBase.Initialize(NetworkBehaviour)
NetworkVariableBase.DefaultReadPerm
NetworkVariableBase.DefaultWritePerm
NetworkVariableBase.Name
NetworkVariableBase.ReadPerm
NetworkVariableBase.WritePerm
NetworkVariableBase.SetDirty(Boolean)
NetworkVariableBase.ResetDirty()
NetworkVariableBase.IsDirty()
NetworkVariableBase.CanClientRead(UInt64)
NetworkVariableBase.CanClientWrite(UInt64)
NetworkVariableBase.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
#
Namespace: Unity.Netcode#
Assembly: MLAPI.dll#
Syntax#
Type ParametersName | Description |
---|---|
T | the unmanaged type for NetworkVariable\<T> |
#
Constructors#
NetworkVariable(T, NetworkVariableReadPermission, NetworkVariableWritePermission)Constructor for NetworkVariable\<T>
#
Declaration#
ParametersType | Name | Description |
---|---|---|
T | value | initial value set that is of type T |
NetworkVariableReadPermission | readPerm | the NetworkVariableReadPermission for this NetworkVariable\<T> |
NetworkVariableWritePermission | writePerm | the NetworkVariableWritePermission for this NetworkVariable\<T> |
#
Fields#
OnValueChangedThe callback to be invoked when the value gets changed
#
Declaration#
Field ValueType | Description |
---|---|
NetworkVariable.OnValueChangedDelegate\<> |
#
Properties#
ValueThe value of the NetworkVariable container
#
Declaration#
Property ValueType | Description |
---|---|
T |
#
Methods#
ReadDelta(FastBufferReader, Boolean)Reads value from the reader and applies it
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferReader | reader | The stream to read the value from |
System.Boolean | keepDirtyDelta | Whether or not the container should keep the dirty delta, or mark the delta as consumed |
#
OverridesNetworkVariableBase.ReadDelta(FastBufferReader, Boolean)
#
ReadField(FastBufferReader)Reads the complete state from the reader and applies it
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferReader | reader | The stream to read the state from |
#
OverridesNetworkVariableBase.ReadField(FastBufferReader)
#
WriteDelta(FastBufferWriter)Writes the variable to the writer
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferWriter | writer | The stream to write the value to |
#
OverridesNetworkVariableBase.WriteDelta(FastBufferWriter)
#
WriteField(FastBufferWriter)Writes the complete state of the variable to the writer
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferWriter | writer | The stream to write the state to |
#
OverridesNetworkVariableBase.WriteField(FastBufferWriter)
#
ImplementsSystem.IDisposable