ByteUtils to extension methods

This commit is contained in:
2026-01-18 16:45:47 +01:00
parent b68b3d1c25
commit 305a0ec3a1
4 changed files with 52 additions and 52 deletions

View File

@@ -134,8 +134,8 @@ public class TestBall : SyncedObject
|| eventType == NetworkEventType.FullSyncForced)
{
Debug.Log($"({nameof(TestBall)}) Sending sync data at progress {GetProgress()} and amountUp {amountUp}.");
ByteUtils.Append(amountUp, data, ref index);
ByteUtils.Append(GetProgress(), data, ref index);
data.Append(amountUp, ref index);
data.Append(GetProgress(), ref index);
}
}
@@ -144,8 +144,8 @@ public class TestBall : SyncedObject
if (eventType == NetworkEventType.FullSync
|| eventType == NetworkEventType.FullSyncForced)
{
amountUp = ByteUtils.ReadFloat(data, ref index);
SetProgress(ByteUtils.ReadFloat(data, ref index));
amountUp = data.ReadFloat(ref index);
SetProgress(data.ReadFloat(ref index));
//Debug.Log($"({nameof(TestBall)}) Received sync event, synced to progress {GetProgress()} and amountUp {amountUp}.");
}
else