Nebula
Core

NetworkSyncBehaviour

Base for components that replicate through the per-tick sync channel and support server or owner authority.

generated from the sources
public abstract class NetworkSyncBehaviour : NetworkBehaviour

Base for components that replicate through the per-tick sync channel and support server or owner authority. NetworkTransform and NetworkAnimator use this base. Derived classes detect changes in AuthorityTick (called once per tick on the copy that produces state) and implement the write/read pair. This class selects the source of state and sends owner state to the worker through 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; }

Whether this copy currently produces the synchronized state.

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);

Called once per tick on the state producer. Compare with the last sent state and call NetworkBehaviour.MarkSyncDirty when 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