Skip to content

Commit

Permalink
NetworkTransform reimplemented (#236)
Browse files Browse the repository at this point in the history
* NetworkTransform reimplemented

* Replace FindLocalObject with NetworkIdentity.spawned

* Syntax

* Comment typo

* Fix comment

* Tests

* Remove 'Some' compression option because Much is good enough

* Added comment
  • Loading branch information
miwarnec committed Jan 4, 2019
1 parent 83ab0d1 commit 65f338b
Show file tree
Hide file tree
Showing 12 changed files with 556 additions and 2,215 deletions.
2 changes: 0 additions & 2 deletions Mirror/Editor/Mirror.Editor.csproj
Expand Up @@ -60,8 +60,6 @@
<ItemGroup>
<Compile Include="NetworkAnimatorEditor.cs" />
<Compile Include="NetworkManagerEditor.cs" />
<Compile Include="NetworkTransformChildEditor.cs" />
<Compile Include="NetworkTransformEditor.cs" />
<Compile Include="NetworkBehaviourInspector.cs" />
<Compile Include="NetworkInformationPreview.cs" />
<Compile Include="NetworkScenePostProcess.cs" />
Expand Down
121 changes: 0 additions & 121 deletions Mirror/Editor/NetworkTransformChildEditor.cs

This file was deleted.

196 changes: 0 additions & 196 deletions Mirror/Editor/NetworkTransformEditor.cs

This file was deleted.

28 changes: 5 additions & 23 deletions Mirror/Runtime/Messages.cs
Expand Up @@ -436,7 +436,7 @@ public override void Serialize(NetworkWriter writer)
}
}

// A client sends this message to the server
// A client sends this message to the server
// to calculate RTT and synchronize time
class NetworkPingMessage : DoubleMessage
{
Expand Down Expand Up @@ -469,41 +469,23 @@ public override void Serialize(NetworkWriter writer)
}
}

class LocalChildTransformMessage : MessageBase
{
public uint netId;
public uint childIndex;
public byte[] payload;

public override void Deserialize(NetworkReader reader)
{
netId = reader.ReadPackedUInt32();
childIndex = reader.ReadPackedUInt32();
payload = reader.ReadBytesAndSize();
}

public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32(netId);
writer.WritePackedUInt32(childIndex);
writer.WriteBytesAndSize(payload);
}
}

class LocalPlayerTransformMessage : MessageBase
class TransformMessage : MessageBase
{
public uint netId;
public int componentIndex;
public byte[] payload;

public override void Deserialize(NetworkReader reader)
{
netId = reader.ReadPackedUInt32();
componentIndex = (int)reader.ReadPackedUInt32();
payload = reader.ReadBytesAndSize();
}

public override void Serialize(NetworkWriter writer)
{
writer.WritePackedUInt32(netId);
writer.WritePackedUInt32((uint)componentIndex);
writer.WriteBytesAndSize(payload);
}
}
Expand Down

0 comments on commit 65f338b

Please sign in to comment.