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

@@ -3,7 +3,7 @@ using UnityEngine;
namespace Marro.PacManUdon
{
public class PelletManager : UdonSharpBehaviour
public class PelletManager : SyncedObject
{
Pellet[] pellets;
Renderer[] pelletRenderers;
@@ -30,14 +30,14 @@ namespace Marro.PacManUdon
SetPowerPelletsBlink(false);
}
void Update()
public override void SyncedUpdate()
{
if (!powerPelletBlinkEnabled)
{
return;
}
powerPelletBlinkProgress += Time.deltaTime;
powerPelletBlinkProgress += networkManager.SyncedDeltaTime;
if (powerPelletBlinkProgress >= powerPelletBlinkToggleInterval)
{
// Debug.Log($"{gameObject} PowerPelletBlink toggle");
@@ -84,6 +84,16 @@ namespace Marro.PacManUdon
}
}
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 int PelletCount => pellets.Length;
}
}