Class NetworkTickSystem
Provides discretized time. This is useful for games that require ticks happening at regular interval on the server and clients.
#
InheritanceSystem.Object
NetworkTickSystem
#
Inherited MembersSystem.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
#
Namespace: Unity.Netcode#
Assembly: MLAPI.dll#
Syntax#
Constructors#
NetworkTickSystem(UInt32, Double, Double)Creates a new instance of the NetworkTickSystem class.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt32 | tickRate | The tick rate |
System.Double | localTimeSec | The initial local time to start at. |
System.Double | serverTimeSec | The initial server time to start at. |
#
Fields#
NoTickSpecial value to indicate "No tick information"
#
Declaration#
Field ValueType | Description |
---|---|
System.Int32 |
#
Properties#
LocalTimeThe 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#
Property ValueType | Description |
---|---|
NetworkTime |
#
ServerTimeThe 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#
Property ValueType | Description |
---|---|
NetworkTime |
#
TickRateThe TickRate of the tick system. This is used to decide how often a fixed network tick is run.
#
Declaration#
Property ValueType | Description |
---|---|
System.UInt32 |
#
Methods#
Reset(Double, Double)Resets the tick system to the given network time.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Double | localTimeSec | The local time in seconds. |
System.Double | serverTimeSec | The server time in seconds. |
#
UpdateTick(Double, Double)Called after advancing the time system to run ticks based on the difference in time.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Double | localTimeSec | The local time in seconds |
System.Double | serverTimeSec | The server time in seconds |
#
Events#
TickGets invoked before every network tick.
#
Declaration#
Event TypeType | Description |
---|---|
System.Action |