using System;
using Unity.Netcode;

//网络同步逻辑基类
public class NetworkBehaviorBase : NetworkBehaviour
{
    public event Action OnNetworkSpawnHook;

    public event Action OnNetworkDespawnHook;

    public override void OnNetworkSpawn()
    {
        base.OnNetworkSpawn();
        OnNetworkSpawnHook?.Invoke();
    }

    public override void OnNetworkDespawn()
    {
        base.OnNetworkDespawn();
        OnNetworkDespawnHook?.Invoke();
    }
}
