Nebula
Core

NetworkSyncBehaviour

Base for components that replicate through the per-tick sync channel and support NGO's server/owner authority choice: NetworkTransform and NetworkAnimator.

generated from the sources
public abstract class NetworkSyncBehaviour : NetworkBehaviour

Base for components that replicate through the per-tick sync channel and support NGO's server/owner authority choice: NetworkTransform and NetworkAnimator. Derived classes detect changes in AuthorityTick (called on whichever copy is the source of truth, once per tick) and implement the write/read pair; this class decides who is authoritative and pumps the owner -> worker leg over a ServerRpc.

Properties

Authority

public AuthorityMode Authority { get; set; }

HasSyncState

public sealed override bool HasSyncState { get; }

IsOwnerAuthoritative

public bool IsOwnerAuthoritative { get; }

Whether owner authority is in effect (the mode is Owner and a client owns the entity).

IsSyncAuthority

public bool IsSyncAuthority { get; }

This copy is the source of truth for the synced state right now.

IsRelayingWorker

protected bool IsRelayingWorker { get; }

This worker holds the entity but the owner drives the state: apply what arrives and re-broadcast it.

Methods

AuthorityTick

protected abstract void AuthorityTick(uint tick, float deltaTime);

Once per tick on the source of truth: compare against what was last sent and NetworkBehaviour.MarkSyncDirty as needed.

ApplyOwnerState

protected virtual void ApplyOwnerState(NetworkReader reader, bool full);

Worker side of owner authority: an owner chunk just arrived. Apply it to the local object immediately (the worker is the simulation; nothing to interpolate) and queue the same deltas for re-broadcast. Default: the ordinary NetworkBehaviour.ReadSyncState at the current tick.

NetworkTick

public override void NetworkTick(uint tick, float deltaTime);

Update

protected virtual void Update();

OnGainedAuthority

public override void OnGainedAuthority();

On this page