ByteUtils to extension methods
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user