Class MyCustomNetworkVariable
Bare minimum example of NetworkVariableBase derived class
Implements
Inherited Members
Namespace: DocumentationCodeSamples
Assembly: Unity.Netcode.Runtime.Tests.dll
Syntax
[Serializable]
public class MyCustomNetworkVariable : NetworkVariableBase, IDisposable
Methods
ReadDelta(FastBufferReader, bool)
Used to read partial updates rather than synchronizing the full state on every change.
Declaration
public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta)
Parameters
| Type | Name | Description |
|---|---|---|
| FastBufferReader | reader | The stream to read the delta from |
| bool | keepDirtyDelta | Whether or not the delta should be kept as dirty or consumed |
Overrides
ReadField(FastBufferReader)
Reads the complete state from the reader and applies it
Declaration
public override void ReadField(FastBufferReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| FastBufferReader | reader | The stream to read the state from |
Overrides
WriteDelta(FastBufferWriter)
Used to write partial updates rather than synchronizing the full state on every change.
Declaration
public override void WriteDelta(FastBufferWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| FastBufferWriter | writer | The stream to write the state to |
Overrides
WriteField(FastBufferWriter)
Writes the complete state of the variable to the writer
Declaration
public override void WriteField(FastBufferWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| FastBufferWriter | writer | The stream to write the state to |