Select your preferred scripting language. All code snippets will be displayed in this language.
class in UnityEngine.Networking
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseGeneral purpose serializer for UNET (for serializing data to byte arrays).
Position | The current position of the internal buffer. |
NetworkWriter | Creates a new NetworkWriter object. |
AsArray | Returns the internal array of bytes the writer is using. This is NOT a copy. |
FinishMessage | This fills out the size header of a message begun with StartMessage(), so that it can be send using Send() functions. |
SeekZero | Seeks to the start of the internal buffer. |
StartMessage | This begins a new message, which should be completed with FinishMessage() once the payload has been written. |
ToArray | Returns a copy of internal array of bytes the writer is using, it copies only the bytes used. |
Write | This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream. |
WriteBytesAndSize | This writes a 16-bit count and a array of bytes of that length to the stream. |
WriteBytesFull | This writes a 16-bit count and an array of bytes of that size to the stream. |
WritePackedUInt32 | This writes the 32-bit value to the stream using variable-length-encoding. |
WritePackedUInt64 | This writes the 64-bit value to the stream using variable-length-encoding. |