NetworkTime
Tick model.
Nebula · Packages/com.1by3.nebula/Runtime/Core/NetworkTime.cspublic static class NetworkTimeTick model. Every worker derives the tick it should be simulating from the wall clock and a fixed origin, so workers agree on tick numbers without a tick master (a restarted worker knows the correct tick immediately, and the control plane is never on the hot path). Gameplay code should only ever see tick numbers, never wall-clock time.
Fields
TickRate
public const int TickRate = 60;TickInterval
public const float TickInterval = 1f / TickRate;Properties
DerivedTick
public static uint DerivedTick { get; }The tick the wall clock says it is right now.
DerivedTickExact
public static double DerivedTickExact { get; }Tick
public static uint Tick { get; }The tick currently being simulated. On a worker this is the authoritative simulation tick. On a client it is the tick the local player is predicting (ahead of the server by the input lead).
LatestServerTick
public static uint LatestServerTick { get; }Latest server tick the client has heard about (client only).
RenderTick
public static double RenderTick { get; }The (fractional) tick non-authoritative copies are presenting right now: on a client a few ticks behind the newest snapshot (InterpolationDelayTicks), on a worker one tick behind the simulation tick for ghosts. Buffered interpolators sample at this tick.
Methods
TicksToSeconds
public static float TicksToSeconds(uint ticks);NetworkSyncBehaviour
Base for components that replicate through the per-tick sync channel and support NGO's server/owner authority choice: NetworkTransform and NetworkAnimator.
NetworkTransform
Replicates a Transform the way NGO's NetworkTransform does: per-axis position/rotation/scale selection, change thresholds, local or world space, server or owner authority, buffered tick interpolation or smooth damping on the receiving si...