Version: 2018.4
LanguageEnglish
  • C#
Method group is Obsolete

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

Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(char value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(byte value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(sbyte value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(short value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(ushort value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(int value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(uint value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(long value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(ulong value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(float value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(double value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Decimal value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(string value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(bool value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(byte[] buffer, int count);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(byte[] buffer, int offset, int count);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Vector2 value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Vector3 value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Vector4 value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Color value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Color32 value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(GameObject value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Quaternion value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Rect value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Plane value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Ray value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(Matrix4x4 value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(MessageBase msg);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(NetworkHash128 value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(NetworkIdentity value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(NetworkInstanceId value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

public void Write(NetworkSceneId value);
Obsolete The high level API classes are deprecated and will be removed in the future.

Declaration

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.

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.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961