mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
perf: update vars is now a value type (#990)
This commit is contained in:
parent
a32c5a9456
commit
f99e71ebdf
@ -369,20 +369,20 @@ public void Serialize(NetworkWriter writer)
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateVarsMessage : MessageBase
|
||||
struct UpdateVarsMessage : IMessageBase
|
||||
{
|
||||
public uint netId;
|
||||
// the serialized component data
|
||||
// -> ArraySegment to avoid unnecessary allocations
|
||||
public ArraySegment<byte> payload;
|
||||
|
||||
public override void Deserialize(NetworkReader reader)
|
||||
public void Deserialize(NetworkReader reader)
|
||||
{
|
||||
netId = reader.ReadPackedUInt32();
|
||||
payload = reader.ReadBytesAndSizeSegment();
|
||||
}
|
||||
|
||||
public override void Serialize(NetworkWriter writer)
|
||||
public void Serialize(NetworkWriter writer)
|
||||
{
|
||||
writer.WritePackedUInt32(netId);
|
||||
writer.WriteBytesAndSizeSegment(payload);
|
||||
|
Loading…
Reference in New Issue
Block a user