C# Class UnityEngine.Networking.NetworkWriter

General purpose serializer for UNET (for serializing data to byte arrays).

Mostra file Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
AsArray ( ) : byte[]

Returns the internal array of bytes the writer is using. This is NOT a copy.

FinishMessage ( ) : void

This fills out the size header of a message begun with StartMessage(), so that it can be send using Send() functions.

NetworkWriter ( ) : System

Creates a new NetworkWriter object.

NetworkWriter ( byte buffer ) : System

Creates a new NetworkWriter object.

SeekZero ( ) : void

Seeks to the start of the internal buffer.

StartMessage ( short msgType ) : void

This begins a new message, which should be completed with FinishMessage() once the payload has been written.

ToArray ( ) : byte[]

Returns a copy of internal array of bytes the writer is using, it copies only the bytes used.

Write ( Color value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Color32 value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( GameObject value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Matrix4x4 value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( MessageBase msg ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( NetworkHash128 value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( NetworkIdentity value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( NetworkInstanceId value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( NetworkSceneId value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Plane value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Quaternion value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Ray value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Rect value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Transform value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Vector2 value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Vector3 value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( Vector4 value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( bool value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( byte value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( byte buffer, int count ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( byte buffer, int offset, int count ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( char value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( decimal value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( double value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( float value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( int value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( long value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( sbyte value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( short value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( string value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( uint value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( ulong value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

Write ( ushort value ) : void

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

WriteBytesAndSize ( byte buffer, int count ) : void

This writes a 16-bit count and a array of bytes of that length to the stream.

WriteBytesFull ( byte buffer ) : void

This writes a 16-bit count and an array of bytes of that size to the stream.

WritePackedUInt32 ( uint value ) : void

This writes the 32-bit value to the stream using variable-length-encoding.

WritePackedUInt64 ( ulong value ) : void

This writes the 64-bit value to the stream using variable-length-encoding.

Private Methods

Method Description
AsArraySegment ( ) : ArraySegment

Method Details

AsArray() public method

Returns the internal array of bytes the writer is using. This is NOT a copy.

public AsArray ( ) : byte[]
return byte[]

FinishMessage() public method

This fills out the size header of a message begun with StartMessage(), so that it can be send using Send() functions.

public FinishMessage ( ) : void
return void

NetworkWriter() public method

Creates a new NetworkWriter object.

public NetworkWriter ( ) : System
return System

NetworkWriter() public method

Creates a new NetworkWriter object.

public NetworkWriter ( byte buffer ) : System
buffer byte A buffer to write into. This is not copied.
return System

SeekZero() public method

Seeks to the start of the internal buffer.

public SeekZero ( ) : void
return void

StartMessage() public method

This begins a new message, which should be completed with FinishMessage() once the payload has been written.

public StartMessage ( short msgType ) : void
msgType short Message type.
return void

ToArray() public method

Returns a copy of internal array of bytes the writer is using, it copies only the bytes used.

public ToArray ( ) : byte[]
return byte[]

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Color value ) : void
value Color The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Color32 value ) : void
value UnityEngine.Color32 The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( GameObject value ) : void
value UnityEngine.GameObject The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Matrix4x4 value ) : void
value UnityEngine.Matrix4x4 The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( MessageBase msg ) : void
msg MessageBase The network message to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( NetworkHash128 value ) : void
value NetworkHash128 The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( NetworkIdentity value ) : void
value NetworkIdentity The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( NetworkInstanceId value ) : void
value NetworkInstanceId The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( NetworkSceneId value ) : void
value NetworkSceneId The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Plane value ) : void
value UnityEngine.Plane The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Quaternion value ) : void
value UnityEngine.Quaternion The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Ray value ) : void
value UnityEngine.Ray The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Rect value ) : void
value UnityEngine.Rect The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Transform value ) : void
value UnityEngine.Transform The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Vector2 value ) : void
value Vector2 The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Vector3 value ) : void
value Vector3 The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( Vector4 value ) : void
value Vector4 The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( bool value ) : void
value bool The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( byte value ) : void
value byte The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( byte buffer, int count ) : void
buffer byte The byte buffer to write.
count int The number of bytes in the byte buffer to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( byte buffer, int offset, int count ) : void
buffer byte The byte buffer to write.
offset int The byte buffer array element to start writing from.
count int The number of bytes in the byte buffer to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( char value ) : void
value char The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( decimal value ) : void
value decimal The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( double value ) : void
value double The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( float value ) : void
value float The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( int value ) : void
value int The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( long value ) : void
value long The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( sbyte value ) : void
value sbyte The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( short value ) : void
value short The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( string value ) : void
value string The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( uint value ) : void
value uint The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( ulong value ) : void
value ulong The object to write.
return void

Write() public method

This writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.

public Write ( ushort value ) : void
value ushort The object to write.
return void

WriteBytesAndSize() public method

This writes a 16-bit count and a array of bytes of that length to the stream.

public WriteBytesAndSize ( byte buffer, int count ) : void
buffer byte Array of bytes to write.
count int Number of bytes from the array to write.
return void

WriteBytesFull() public method

This writes a 16-bit count and an array of bytes of that size to the stream.

public WriteBytesFull ( byte buffer ) : void
buffer byte Bytes to write.
return void

WritePackedUInt32() public method

This writes the 32-bit value to the stream using variable-length-encoding.

public WritePackedUInt32 ( uint value ) : void
value uint Value to write.
return void

WritePackedUInt64() public method

This writes the 64-bit value to the stream using variable-length-encoding.

public WritePackedUInt64 ( ulong value ) : void
value ulong Value to write.
return void