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

@@ -1,12 +1,9 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using TMPro;
using UnityEngine;
using TMPro;
public class StatusDisplay : UdonSharpBehaviour
namespace Marro.PacManUdon
{
public class StatusDisplay : SyncedObject
{
[SerializeField] private Transform scoreDisplayGroup;
[SerializeField] private TMP_Text label1UPText;
@@ -28,7 +25,7 @@
private bool label1UPVisible;
private bool label1UPTextBlinking;
private float labelBlinkToggleInterval = 0.26666667f;
private const float labelBlinkToggleInterval = 0.26666667f;
private float labelBlinkTimer;
public void Initialize()
@@ -53,11 +50,11 @@
SetLabel1UPTextBlinking(false);
}
void Update()
public override void SyncedUpdate()
{
if (label1UPTextBlinking)
{
labelBlinkTimer += Time.deltaTime;
labelBlinkTimer += networkManager.SyncedDeltaTime;
if (labelBlinkTimer > labelBlinkToggleInterval)
{
labelBlinkTimer -= labelBlinkToggleInterval;
@@ -169,5 +166,15 @@
levelDisplayDigitAnimators[i].SetFloat("FruitType", PacManConstants.FruitTypeToValue(PacManConstants.GetFruitTypeForLevel(level - i)));
}
}
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
{
}
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
return true;
}
}
}