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

パラメーター

value書き込むオブジェクト
buffer書き込むバイトバッファ
count書き込むバイトバッファのバイト数
offset書き込みを始めるバイトバッファ配列の要素
msg書き込むネットワークメッセージ

説明

オブジェクト、値、バッファ、ネットワークメッセージへの参照を NetworkIdentity コンポーネントと一緒にストリームに書き込みます。

using UnityEngine;
using UnityEngine.Networking;

public class ExampleScript : MonoBehaviour { void Start() { short myMsgType = 444;

NetworkWriter writer = new NetworkWriter(); writer.StartMessage(myMsgType); writer.Write("test data"); writer.FinishMessage(); } }

See NetworkWriting for another code example.