Legacy Documentation: Version 5.5
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NetworkWriter.Write

Suggest a change

Success!

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.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public function Write(value: char): void;
public void Write(char value);
public function Write(value: byte): void;
public void Write(byte value);
public function Write(value: sbyte): void;
public void Write(sbyte value);
public function Write(value: short): void;
public void Write(short value);
public function Write(value: ushort): void;
public void Write(ushort value);
public function Write(value: int): void;
public void Write(int value);
public function Write(value: uint): void;
public void Write(uint value);
public function Write(value: long): void;
public void Write(long value);
public function Write(value: ulong): void;
public void Write(ulong value);
public function Write(value: float): void;
public void Write(float value);
public function Write(value: double): void;
public void Write(double value);
public function Write(value: Decimal): void;
public void Write(Decimal value);
public function Write(value: string): void;
public void Write(string value);
public function Write(value: bool): void;
public void Write(bool value);
public function Write(buffer: byte[], count: int): void;
public void Write(byte[] buffer, int count);
public function Write(buffer: byte[], offset: int, count: int): void;
public void Write(byte[] buffer, int offset, int count);
public function Write(value: Vector2): void;
public void Write(Vector2 value);
public function Write(value: Vector3): void;
public void Write(Vector3 value);
public function Write(value: Vector4): void;
public void Write(Vector4 value);
public function Write(value: Color): void;
public void Write(Color value);
public function Write(value: Color32): void;
public void Write(Color32 value);
public function Write(value: GameObject): void;
public void Write(GameObject value);
public function Write(value: Quaternion): void;
public void Write(Quaternion value);
public function Write(value: Rect): void;
public void Write(Rect value);
public function Write(value: Plane): void;
public void Write(Plane value);
public function Write(value: Ray): void;
public void Write(Ray value);
public function Write(value: Matrix4x4): void;
public void Write(Matrix4x4 value);
public function Write(msg: Networking.MessageBase): void;
public void Write(Networking.MessageBase msg);
public function Write(value: Networking.NetworkHash128): void;
public void Write(Networking.NetworkHash128 value);
public function Write(value: Networking.NetworkIdentity): void;
public void Write(Networking.NetworkIdentity value);
public function Write(value: Networking.NetworkInstanceId): void;
public void Write(Networking.NetworkInstanceId value);
public function Write(value: Networking.NetworkSceneId): void;
public void Write(Networking.NetworkSceneId value);
public function Write(value: Transform): void;
public void Write(Transform value);

Parameters

value The object to write.
buffer The byte buffer to write.
count The number of bytes in the byte buffer to write.
offset The byte buffer array element to start writing from.
msg The network message to write.

Description

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