Working well now I think?
This commit is contained in:
@@ -132,7 +132,8 @@ public class TestBall : SyncedObject
|
||||
|
||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType == 0)
|
||||
if (eventType == NetworkEventType.FullSync
|
||||
|| eventType == NetworkEventType.FullSyncForced)
|
||||
{
|
||||
Debug.Log($"({nameof(TestBall)}) Sending sync data at progress {GetProgress()} and amountUp {amountUp}.");
|
||||
data[index++] = BitConverter.GetBytes(amountUp);
|
||||
@@ -142,18 +143,19 @@ public class TestBall : SyncedObject
|
||||
|
||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType == 0)
|
||||
if (eventType == NetworkEventType.FullSync
|
||||
|| eventType == NetworkEventType.FullSyncForced)
|
||||
{
|
||||
amountUp = BitConverter.ToSingle(data, index);
|
||||
SetProgress(BitConverter.ToSingle(data, index + 4));
|
||||
Debug.Log($"({nameof(TestBall)}) Received sync event, synced to progress {GetProgress()} and amountUp {amountUp}.");
|
||||
//Debug.Log($"({nameof(TestBall)}) Received sync event, synced to progress {GetProgress()} and amountUp {amountUp}.");
|
||||
index += 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"({nameof(TestBall)}) Received up event, jumped up at {GetProgress()} from {amountUp}.");
|
||||
//Debug.Log($"({nameof(TestBall)}) Received up event, jumped up at {GetProgress()} from {amountUp}.");
|
||||
Jump();
|
||||
Debug.Log($"({nameof(TestBall)}) Received up event, jumped up at {GetProgress()} to {amountUp}.");
|
||||
//Debug.Log($"({nameof(TestBall)}) Received up event, jumped up at {GetProgress()} to {amountUp}.");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class TestBallManager : UdonSharpBehaviour
|
||||
testBall.UpButtonPressed();
|
||||
}
|
||||
|
||||
networkManager.SendEvent((NetworkEventType)1);
|
||||
networkManager.SendEvent(NetworkEventType.PacManTurn);
|
||||
}
|
||||
|
||||
public void SyncButtonPressed()
|
||||
|
||||
Reference in New Issue
Block a user