diff --git a/Assets/Mirror/Components/PredictedRigidbody/PredictedSyncData.cs b/Assets/Mirror/Components/PredictedRigidbody/PredictedSyncData.cs index a8e796c4a..ed08c7787 100644 --- a/Assets/Mirror/Components/PredictedRigidbody/PredictedSyncData.cs +++ b/Assets/Mirror/Components/PredictedRigidbody/PredictedSyncData.cs @@ -39,23 +39,12 @@ public static class PredictedSyncDataReadWrite { public static void WritePredictedSyncData(this NetworkWriter writer, PredictedSyncData data) { - writer.WriteFloat(data.deltaTime); - writer.WriteVector3(data.position); - writer.WriteQuaternion(data.rotation); - writer.WriteVector3(data.velocity); - writer.WriteVector3(data.angularVelocity); + writer.WriteBlittable(data); } public static PredictedSyncData ReadPredictedSyncData(this NetworkReader reader) { - return new PredictedSyncData - { - deltaTime = reader.ReadFloat(), - position = reader.ReadVector3(), - rotation = reader.ReadQuaternion(), - velocity = reader.ReadVector3(), - angularVelocity = reader.ReadVector3() - }; + return reader.ReadBlittable(); } } } diff --git a/Assets/Mirror/Core/AssemblyInfo.cs b/Assets/Mirror/Core/AssemblyInfo.cs index f342716a8..a9c64421b 100644 --- a/Assets/Mirror/Core/AssemblyInfo.cs +++ b/Assets/Mirror/Core/AssemblyInfo.cs @@ -10,3 +10,4 @@ [assembly: InternalsVisibleTo("Mirror.Tests.Performance.Editor")] [assembly: InternalsVisibleTo("Mirror.Tests.Performance.Runtime")] [assembly: InternalsVisibleTo("Mirror.Editor")] +[assembly: InternalsVisibleTo("Mirror.Components")]