Successful sync test
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user