Successful sync test

This commit is contained in:
2026-01-01 20:44:34 +01:00
parent 97fe8cd69f
commit 69a0a752be
19 changed files with 3173 additions and 740 deletions

View File

@@ -1,6 +1,5 @@
namespace Marro.PacManUdon
{
using Assets.Scripts;
using System;
using UdonSharp;
using UnityEngine;
@@ -33,7 +32,7 @@ namespace Marro.PacManUdon
protected abstract void UpdateAnimator();
public override void AppendSyncedData(byte[][] data, ref int offset)
public override void AppendSyncedData(byte[][] data, ref int offset, NetworkEventType eventType, uint eventTime)
{
var position = GetPosition();
data[offset++] = BitConverter.GetBytes(position.x);
@@ -44,7 +43,7 @@ namespace Marro.PacManUdon
data[offset++] = BitConverter.GetBytes(direction.y);
}
public override bool SetSyncedData(byte[] data, ref int offset)
public override bool SetSyncedData(byte[] data, ref int offset, NetworkEventType eventType, uint eventTime)
{
SetPosition(new Vector2(BitConverter.ToSingle(data, offset), BitConverter.ToSingle(data, offset + 2)));
SetDirection(new Vector2(BitConverter.ToSingle(data, offset + 4), BitConverter.ToSingle(data, offset + 6)));
@@ -52,5 +51,10 @@ namespace Marro.PacManUdon
return true;
}
public override void SyncedToNewTime(uint oldTime, uint newTime)
{
}
}
}