17 lines
608 B
C#
17 lines
608 B
C#
using System.Collections;
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
|
|
namespace Marro.PacManUdon
|
|
{
|
|
public abstract class SyncedObject : UdonSharpBehaviour
|
|
{
|
|
public NetworkManager networkManager;
|
|
|
|
public virtual void SyncedUpdate() { }
|
|
public virtual void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) { }
|
|
public virtual bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) { return false; }
|
|
|
|
protected void SubscribeToEvent(NetworkEventType eventType) => networkManager.SubscribeToEvent(this, eventType);
|
|
}
|
|
} |