docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MockTimeProvider

    A mock timer that implements the Unity.Netcode.IRealTimeProvider interface used with integration testing.

    Inheritance
    object
    MockTimeProvider
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)