Working via NetworkManager

This commit is contained in:
2026-01-14 21:39:24 +01:00
parent 89607f0868
commit fb902aaddc
26 changed files with 3106 additions and 2561 deletions

View File

@@ -7,7 +7,7 @@ namespace Marro.PacManUdon
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))]
[RequireComponent(typeof(Collider))]
public class BonusFruit : UdonSharpBehaviour
public class BonusFruit : SyncedObject
{
PacManFruitType fruitType;
@@ -31,11 +31,11 @@ namespace Marro.PacManUdon
SetActive(false);
}
void Update()
public override void SyncedUpdate()
{
if (active && !frozen)
{
activeCountdown -= Time.deltaTime;
activeCountdown -= networkManager.SyncedDeltaTime;
if (activeCountdown <= 0)
{
SetActive(false);
@@ -82,6 +82,16 @@ namespace Marro.PacManUdon
this.active = active;
}
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
{
}
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
return true;
}
public PacManFruitType FruitType
{
set