docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class NetworkTimeSystemTests

    Runtime tests to test the network time system with the Unity player loop.

    Inheritance
    object
    NetworkTimeSystemTests
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Netcode.RuntimeTests
    Assembly: Unity.Netcode.RuntimeTests.dll
    Syntax
    public class NetworkTimeSystemTests

    Methods

    CorrectAmountTicksTest()

    Tests whether the time system invokes the correct amount of ticks over a period of time. Note we cannot test against Time.Time directly because of floating point precision. Our time is more precise leading to different results.

    Declaration
    [UnityTest]
    public IEnumerator CorrectAmountTicksTest()
    Returns
    Type Description
    IEnumerator

    An IEnumerator for the UnityTest coroutine.

    PlayerLoopFixedTimeTest()

    Tests whether time is accessible and has correct values inside Update/FixedUpdate. This test applies only when timeScale is 1.

    Declaration
    [UnityTest]
    public IEnumerator PlayerLoopFixedTimeTest()
    Returns
    Type Description
    IEnumerator

    An IEnumerator for the UnityTest coroutine that validates time values in the player loop.

    PlayerLoopTimeTest_WithDifferentTimeScale(float)

    Tests whether time is accessible and has correct values inside Update, for multiples timeScale values.

    Declaration
    [UnityTest]
    public IEnumerator PlayerLoopTimeTest_WithDifferentTimeScale(float timeScale)
    Parameters
    Type Name Description
    float timeScale
    Returns
    Type Description
    IEnumerator

    An IEnumerator for the UnityTest coroutine that validates time values under different time scales.

    Setup()

    Declaration
    [SetUp]
    public void Setup()

    TearDown()

    Declaration
    [TearDown]
    public void TearDown()
    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)