Class MockTimeProvider
A mock timer that implements the Unity.Netcode.IRealTimeProvider interface used with integration testing.
Inherited Members
Namespace: Unity.Netcode.TestHelpers.Runtime
Assembly: Unity.Netcode.Runtime.Tests.dll
Syntax
public class MockTimeProvider
Properties
DeltaTime
Returns the delta time.
Declaration
public float DeltaTime { get; }
Property Value
Type | Description |
---|---|
float |
FixedDeltaTime
Returns the fixed delta time.
Declaration
public float FixedDeltaTime { get; }
Property Value
Type | Description |
---|---|
float |
RealTimeSinceStartup
Returns realtime since start up.
Declaration
public float RealTimeSinceStartup { get; }
Property Value
Type | Description |
---|---|
float |
StaticDeltaTime
Static version of the DeltaTime.
Declaration
public static float StaticDeltaTime { get; }
Property Value
Type | Description |
---|---|
float |
StaticRealTimeSinceStartup
Static version of the RealTimeSinceStartup.
Declaration
public static float StaticRealTimeSinceStartup { get; }
Property Value
Type | Description |
---|---|
float |
StaticUnscaledDeltaTime
Static version of the UnscaledDeltaTime.
Declaration
public static float StaticUnscaledDeltaTime { get; }
Property Value
Type | Description |
---|---|
float |
StaticUnscaledTime
Static version of the UnscaledTime.
Declaration
public static float StaticUnscaledTime { get; }
Property Value
Type | Description |
---|---|
float |
UnscaledDeltaTime
Returns the unscaled delta time.
Declaration
public float UnscaledDeltaTime { get; }
Property Value
Type | Description |
---|---|
float |
UnscaledTime
Returns the unscaled time.
Declaration
public float UnscaledTime { get; }
Property Value
Type | Description |
---|---|
float |
Methods
Reset()
Resets the delta and real time values.
Declaration
public static void Reset()
TimeTravel(double)
Invoke to force this time provider to time travel to a specific point in time.
Declaration
public static void TimeTravel(double amountOfTimeTraveled)
Parameters
Type | Name | Description |
---|---|---|
double | amountOfTimeTraveled | Amount of time to travel. |