Working via NetworkManager
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user