本文整理汇总了C#中UnityEngine.Networking.NetworkWriter.WritePackedUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkWriter.WritePackedUInt32方法的具体用法?C# NetworkWriter.WritePackedUInt32怎么用?C# NetworkWriter.WritePackedUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Networking.NetworkWriter
的用法示例。
在下文中一共展示了NetworkWriter.WritePackedUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32((uint) this.oldConnectionId);
writer.WritePackedUInt32((uint) this.playerControllerId);
writer.Write(this.netId);
writer.WriteBytesAndSize(this.msgData, this.msgSize);
}
示例2: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32((uint) this.connectionId);
writer.Write(this.address);
writer.WritePackedUInt32((uint) this.port);
writer.Write(this.isHost);
writer.Write(this.isYou);
}
示例3: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.Write(this.netId);
writer.WriteBytesFull(this.payload);
writer.Write(this.teleport);
writer.WritePackedUInt32((uint) this.time);
}
示例4: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.Write(this.netId);
writer.WritePackedUInt32((uint) this.stateHash);
writer.Write(this.normalizedTime);
writer.WriteBytesAndSize(this.parameters, this.parameters.Length);
}
示例5: Serialize
public static byte[] Serialize(INetMsg msg)
{
var networkWriter = new NetworkWriter();
uint index = GetMsgIndexFromType( msg.GetType() );
networkWriter.WritePackedUInt32( index );
((MessageBase)msg).Serialize(networkWriter);
return networkWriter.AsArray();
}
示例6: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32((uint) this.oldServerConnectionId);
writer.Write((ushort) this.peers.Length);
for (int i = 0; i < this.peers.Length; i++)
{
this.peers[i].Serialize(writer);
}
}
示例7: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32((uint) this.connectionId);
writer.Write(this.address);
writer.WritePackedUInt32((uint) this.port);
writer.Write(this.isHost);
writer.Write(this.isYou);
if (this.playerIds == null)
{
writer.WritePackedUInt32(0);
}
else
{
writer.WritePackedUInt32((uint) this.playerIds.Length);
for (int i = 0; i < this.playerIds.Length; i++)
{
writer.Write(this.playerIds[i].netId);
writer.WritePackedUInt32((uint) this.playerIds[i].playerControllerId);
}
}
}
示例8: OnSerialize
public override bool OnSerialize(NetworkWriter writer, bool initialState)
{
writer.WritePackedUInt32(1);
writer.Write(this.m_Slot);
writer.Write(this.m_ReadyToBegin);
return true;
}
示例9: OnSerialize
public override bool OnSerialize(NetworkWriter writer, bool initialState)
{
if (!initialState)
{
if ((int) this.syncVarDirtyBits == 0)
{
writer.WritePackedUInt32(0U);
return false;
}
writer.WritePackedUInt32(1U);
}
switch (this.transformSyncMode)
{
case NetworkTransform.TransformSyncMode.SyncNone:
return false;
case NetworkTransform.TransformSyncMode.SyncTransform:
this.SerializeModeTransform(writer);
break;
case NetworkTransform.TransformSyncMode.SyncRigidbody2D:
this.SerializeMode2D(writer);
break;
case NetworkTransform.TransformSyncMode.SyncRigidbody3D:
this.SerializeMode3D(writer);
break;
case NetworkTransform.TransformSyncMode.SyncCharacterController:
this.SerializeModeCharacterController(writer);
break;
}
return true;
}
示例10: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32((uint) this.value);
}
示例11: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.Write(this.netId);
writer.WritePackedUInt32((uint) this.hash);
}
示例12: WriteParameters
private void WriteParameters(NetworkWriter writer, bool autoSend)
{
for (int index = 0; index < this.m_Animator.parameters.Length; ++index)
{
if (!autoSend || this.GetParameterAutoSend(index))
{
AnimatorControllerParameter controllerParameter = this.m_Animator.parameters[index];
if (controllerParameter.type == AnimatorControllerParameterType.Int)
{
writer.WritePackedUInt32((uint) this.m_Animator.GetInteger(controllerParameter.nameHash));
this.SetSendTrackingParam(controllerParameter.name + ":" + this.m_Animator.GetInteger(controllerParameter.nameHash).ToString(), index);
}
if (controllerParameter.type == AnimatorControllerParameterType.Float)
{
writer.Write(this.m_Animator.GetFloat(controllerParameter.nameHash));
this.SetSendTrackingParam(controllerParameter.name + ":" + this.m_Animator.GetFloat(controllerParameter.nameHash).ToString(), index);
}
if (controllerParameter.type == AnimatorControllerParameterType.Bool)
{
writer.Write(this.m_Animator.GetBool(controllerParameter.nameHash));
this.SetSendTrackingParam(controllerParameter.name + ":" + this.m_Animator.GetBool(controllerParameter.nameHash).ToString(), index);
}
}
}
}
示例13: WriteParameters
private void WriteParameters(NetworkWriter writer, bool autoSend)
{
for (int i = 0; i < this.m_Animator.parameters.Length; i++)
{
if (!autoSend || this.GetParameterAutoSend(i))
{
AnimatorControllerParameter parameter = this.m_Animator.parameters[i];
if (parameter.type == AnimatorControllerParameterType.Int)
{
writer.WritePackedUInt32((uint) this.m_Animator.GetInteger(parameter.nameHash));
this.SetSendTrackingParam(parameter.name + ":" + this.m_Animator.GetInteger(parameter.nameHash), i);
}
if (parameter.type == AnimatorControllerParameterType.Float)
{
writer.Write(this.m_Animator.GetFloat(parameter.nameHash));
this.SetSendTrackingParam(parameter.name + ":" + this.m_Animator.GetFloat(parameter.nameHash), i);
}
if (parameter.type == AnimatorControllerParameterType.Bool)
{
writer.Write(this.m_Animator.GetBool(parameter.nameHash));
this.SetSendTrackingParam(parameter.name + ":" + this.m_Animator.GetBool(parameter.nameHash), i);
}
}
}
}
示例14: Serialize
public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32((uint) this.connectionId);
writer.Write(this.netId);
writer.Write(this.authorityState);
}
示例15: OnSerialize
public override bool OnSerialize(NetworkWriter writer, bool initialState)
{
if (!initialState)
{
if ((int) this.syncVarDirtyBits == 0)
{
writer.WritePackedUInt32(0U);
return false;
}
writer.WritePackedUInt32(1U);
}
this.SerializeModeTransform(writer);
return true;
}