Working well now I think?

This commit is contained in:
2026-01-12 21:00:49 +01:00
parent e76df964e5
commit da0e6699e7
5 changed files with 609 additions and 552 deletions

View File

@@ -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;

View File

@@ -49,7 +49,7 @@ public class TestBallManager : UdonSharpBehaviour
testBall.UpButtonPressed();
}
networkManager.SendEvent((NetworkEventType)1);
networkManager.SendEvent(NetworkEventType.PacManTurn);
}
public void SyncButtonPressed()