本文整理汇总了C#中UnityEngine.Networking.NetworkWriter.FinishMessage方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkWriter.FinishMessage方法的具体用法?C# NetworkWriter.FinishMessage怎么用?C# NetworkWriter.FinishMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Networking.NetworkWriter
的用法示例。
在下文中一共展示了NetworkWriter.FinishMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostInternalMessage
private void PostInternalMessage(short msgType)
{
NetworkWriter writer = new NetworkWriter();
writer.StartMessage(msgType);
writer.FinishMessage();
this.PostInternalMessage(writer.AsArray(), 0);
}
示例2: InvokeHandlerOnClient
internal void InvokeHandlerOnClient(short msgType, MessageBase msg, int channelId)
{
NetworkWriter writer = new NetworkWriter();
writer.StartMessage(msgType);
msg.Serialize(writer);
writer.FinishMessage();
this.InvokeBytesOnClient(writer.AsArray(), channelId);
}
示例3: Serialize
public override void Serialize(NetworkWriter writer) {
writer.StartMessage(MSGID);
//Send the number of elements
writer.Write(inputsList.Count);//int32
//Add the entire list
foreach(Inputs i in inputsList) {
writer.Write(i.crouch);//bool
writer.Write(i.jump);//bool
writer.Write(i.move);//bool
writer.Write(i.pitch);//float
writer.Write(i.rotate);//bool
writer.Write(i.timeStamp);//long
writer.Write(i.walk);//bool
writer.Write(i.wasd[0]);//bool
writer.Write(i.wasd[1]);//bool
writer.Write(i.wasd[2]);//bool
writer.Write(i.wasd[3]);//bool
writer.Write(i.yaw);//float
}
writer.FinishMessage();
}