Struct NetworkTime
Present on both client and server world, singleton component that contains all the timing characterist of the client/server simulation loop.
Inherited Members
Namespace: Unity.NetCode
Assembly: solution.dll
Syntax
public struct NetworkTime : IComponentData, IQueryTypeParameter
Fields
Name | Description |
---|---|
Interpolation |
The current interpolated tick (integral part). Always less then the ServerTick on the Client (and equals to ServerTick on the server). |
Interpolation |
The fractional part of the tick (XXX.fraction). Always in between (0.0, 1.0] |
Server |
The current simulated server tick the server will run this frame. Always start from 1. 0 is consider an invalid value. The ServerTick value behave differently on client and server. On the server:
|
Server |
Only meaningful on the client that run at variable step rate. On the server is always 1.0. Always in range is (0.0 and 1.0]. |
Simulation |
The number of simulation steps this tick is scaled with. This is used to make one update which covers N ticks in order to reduce CPU cost. This is always 1 for partial ticks in the prediction loop, but can be more than 1 for partial ticks outside the prediction loop. |
Properties
Name | Description |
---|---|
Is |
Only valid on server. True when the current simulated tick is running with a variabled delta time to recover from a previous long running frame. |
Is |
Only valid inside the prediction loop. The current server tick which will be the last full tick we are predicting |
Is |
Only valid inside the prediction loop. The current server tick which will be the last tick to predict |
Is |
Only valid inside the prediction loop. The server tick the prediction is starting from. |
Is |
Only valid inside the prediction loop. True when this |
Is |
Indicate that the current server tick is a predicted one and the simulation is running inside the prediction group. |
Is |
True if the current tick is running with delta time that is a fraction of the ServerTickDeltaTime. Only true on the client when running at variable frame rate. |