Skip to main content

Unity.Netcode.NetworkTickSystem

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Inherited Members#

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public class NetworkTickSystem

NetworkTickSystem(UInt32, Double, Double)#

Creates a new instance of the NetworkTickSystem class.

Declaration#

public NetworkTickSystem(uint tickRate, double localTimeSec, double serverTimeSec)

Parameters#

TypeNameDescription
System.UInt32tickRateThe tick rate
System.DoublelocalTimeSecThe initial local time to start at.
System.DoubleserverTimeSecThe initial server time to start at.

#

NoTick#

Special value to indicate "No tick information"

Declaration#

public const int NoTick = -2147483648

Field Value#

TypeDescription
System.Int32

#

LocalTime#

The current local time. This is the time at which predicted or client authoritative objects move. This value is accurate when called in Update or during the Tick event but does not work correctly for FixedUpdate.

Declaration#

public NetworkTime LocalTime { get; }

Property Value#

TypeDescription
NetworkTime

ServerTime#

The current server time. This value is mostly used for internal purposes and to interpolate state received from the server. This value is accurate when called in Update or during the Tick event but does not work correctly for FixedUpdate.

Declaration#

public NetworkTime ServerTime { get; }

Property Value#

TypeDescription
NetworkTime

TickRate#

The TickRate of the tick system. This is used to decide how often a fixed network tick is run.

Declaration#

public uint TickRate { get; }

Property Value#

TypeDescription
System.UInt32

#

Reset(Double, Double)#

Resets the tick system to the given network time.

Declaration#

public void Reset(double localTimeSec, double serverTimeSec)

Parameters#

TypeNameDescription
System.DoublelocalTimeSecThe local time in seconds.
System.DoubleserverTimeSecThe server time in seconds.

UpdateTick(Double, Double)#

Called after advancing the time system to run ticks based on the difference in time.

Declaration#

public void UpdateTick(double localTimeSec, double serverTimeSec)

Parameters#

TypeNameDescription
System.DoublelocalTimeSec
System.DoubleserverTimeSec

#

Tick#

Gets invoked before every network tick.

Declaration#

public event Action Tick

Event Type#

TypeDescription
System.Action