Skip to content

Commit

Permalink
perf: SpawnSceneObjectMessage is now a value type
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Jul 29, 2019
1 parent a44efd1 commit 40c7d97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Assets/Mirror/Runtime/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void Serialize(NetworkWriter writer)
}
}

class SpawnSceneObjectMessage : MessageBase
struct SpawnSceneObjectMessage : IMessageBase
{
public uint netId;
public bool owner;
Expand All @@ -284,7 +284,7 @@ class SpawnSceneObjectMessage : MessageBase
// -> ArraySegment to avoid unnecessary allocations
public ArraySegment<byte> payload;

public override void Deserialize(NetworkReader reader)
public void Deserialize(NetworkReader reader)
{
netId = reader.ReadPackedUInt32();
owner = reader.ReadBoolean();
Expand All @@ -295,7 +295,7 @@ public override void Deserialize(NetworkReader reader)
payload = reader.ReadBytesAndSizeSegment();
}

public override void Serialize(NetworkWriter writer)
public void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32(netId);
writer.WriteBoolean(owner);
Expand Down

0 comments on commit 40c7d97

Please sign in to comment.