docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class NetworkTimeTests

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

    Methods

    NetworkTickAdvanceTest()

    Declaration
    [Test]
    public void NetworkTickAdvanceTest()

    NetworkTimeAddFloatTest(double)

    Declaration
    [Test]
    [TestCase(17.32)]
    [TestCase(34)]
    [TestCase(-42.4)]
    [TestCase(-6)]
    [TestCase(35204649.95081967)]
    public void NetworkTimeAddFloatTest(double time)
    Parameters
    Type Name Description
    double time

    NetworkTimeAddNetworkTimeTest(double)

    Declaration
    [Test]
    [TestCase(17.32)]
    [TestCase(34)]
    [TestCase(-42.4)]
    [TestCase(-6)]
    [TestCase(35204649.95081967)]
    public void NetworkTimeAddNetworkTimeTest(double time)
    Parameters
    Type Name Description
    double time

    NetworkTimeAdvanceTest()

    Declaration
    [Test]
    public void NetworkTimeAdvanceTest()

    NetworkTimeCreate(double, double, double)

    Declaration
    [Test]
    [TestCase(34, 0)]
    [TestCase(17.32, 0.0033333333333333335)]
    [TestCase(-42.44, 0.009999999999999998)]
    [TestCase(-6, 0)]
    [TestCase(35204649.95081967, 0.00082, 10)]
    public void NetworkTimeCreate(double time, double tickOffset, double epsilon = 0.0001)
    Parameters
    Type Name Description
    double time
    double tickOffset
    double epsilon

    NetworkTimeDefault()

    Declaration
    [Test]
    public void NetworkTimeDefault()

    NetworkTimeSubFloatTest(double)

    Declaration
    [Test]
    [TestCase(17.32)]
    [TestCase(34)]
    [TestCase(-42.4)]
    [TestCase(-6)]
    [TestCase(35204649.95081967)]
    public void NetworkTimeSubFloatTest(double time)
    Parameters
    Type Name Description
    double time

    NetworkTimeSubNetworkTimeTest(double)

    Declaration
    [Test]
    [TestCase(17.32)]
    [TestCase(34)]
    [TestCase(-42.4)]
    [TestCase(-6)]
    [TestCase(35204649.95081967)]
    public void NetworkTimeSubNetworkTimeTest(double time)
    Parameters
    Type Name Description
    double time

    TestFailCreateInvalidTime(double, uint)

    Declaration
    [Test]
    [TestCase(0, 0)]
    [TestCase(5, 0)]
    [TestCase(-5, 0)]
    public void TestFailCreateInvalidTime(double time, uint tickrate)
    Parameters
    Type Name Description
    double time
    uint tickrate

    TestTimeAsFloat(double, float, uint)

    Declaration
    [Test]
    [TestCase(0, 0, 20)]
    [TestCase(0, 0, 30)]
    [TestCase(0, 0, 60)]
    [TestCase(201, 201, 20)]
    [TestCase(201, 201, 30)]
    [TestCase(201, 201, 60)]
    [TestCase(-4301, -4301, 20)]
    [TestCase(-4301, -4301, 30)]
    [TestCase(-4301, -4301, 60)]
    [TestCase(3.4028235E+38, 3.4028235E+38, 20)]
    [TestCase(3.4028235E+38, 3.4028235E+38, 30)]
    [TestCase(3.4028235E+38, 3.4028235E+38, 60)]
    public void TestTimeAsFloat(double d, float f, uint tickRate)
    Parameters
    Type Name Description
    double d
    float f
    uint tickRate

    TestToFixedTime(double, double, uint)

    Declaration
    [Test]
    [TestCase(53.55, 53.5, 10)]
    [TestCase(1013553.55, 1013553.5, 10)]
    [TestCase(0, 0, 10)]
    [TestCase(-27.41, -27.5, 10)]
    [TestCase(53.55, 53.54, 50)]
    [TestCase(1013553.55, 1013553.54, 50)]
    [TestCase(0, 0, 50)]
    [TestCase(-27.4133, -27.42, 50)]
    public void TestToFixedTime(double time, double expectedFixedTime, uint tickRate)
    Parameters
    Type Name Description
    double time
    double expectedFixedTime
    uint tickRate
    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)