docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class NetworkTransformBase

    Inheritance
    object
    NetcodeIntegrationTest
    IntegrationTestWithApproximation
    NetworkTransformBase
    NetworkTransformGeneral
    NetworkTransformPacketLossTests
    NetworkTransformTests
    Inherited Members
    IntegrationTestWithApproximation.EulerDelta(float, float)
    IntegrationTestWithApproximation.EulerDelta(Vector3, Vector3)
    IntegrationTestWithApproximation.ApproximatelyEuler(float, float)
    IntegrationTestWithApproximation.Approximately(float, float)
    IntegrationTestWithApproximation.Approximately(Vector2, Vector2)
    IntegrationTestWithApproximation.Approximately(Vector3, Vector3)
    IntegrationTestWithApproximation.Approximately(Quaternion, Quaternion)
    IntegrationTestWithApproximation.ApproximatelyEuler(Vector3, Vector3)
    IntegrationTestWithApproximation.GetRandomVector3(float, float)
    NetcodeIntegrationTest.s_GlobalTimeoutHelper
    NetcodeIntegrationTest.s_DefaultWaitForTick
    NetcodeIntegrationTest.NetcodeLogAssert
    NetcodeIntegrationTest.s_GlobalNetworkObjects
    NetcodeIntegrationTest.k_DefaultTickRate
    NetcodeIntegrationTest.m_CreateServerFirst
    NetcodeIntegrationTest.m_PlayerPrefab
    NetcodeIntegrationTest.m_ServerNetworkManager
    NetcodeIntegrationTest.m_ClientNetworkManagers
    NetcodeIntegrationTest.m_PlayerNetworkObjects
    NetcodeIntegrationTest.m_UseHost
    NetcodeIntegrationTest.m_TargetFrameRate
    NetcodeIntegrationTest.RegisterNetworkObject(NetworkObject)
    NetcodeIntegrationTest.DeregisterNetworkObject(NetworkObject)
    NetcodeIntegrationTest.DeregisterNetworkObject(ulong, ulong)
    NetcodeIntegrationTest.VerboseDebug(string)
    NetcodeIntegrationTest.OnSetVerboseDebug()
    NetcodeIntegrationTest.OnSetIntegrationTestMode()
    NetcodeIntegrationTest.OneTimeSetup()
    NetcodeIntegrationTest.SetUp()
    NetcodeIntegrationTest.OnPlayerPrefabGameObjectCreated()
    NetcodeIntegrationTest.CreateServerAndClients()
    NetcodeIntegrationTest.OnNewClientStarted(NetworkManager)
    NetcodeIntegrationTest.OnNewClientStartedAndConnected(NetworkManager)
    NetcodeIntegrationTest.ShouldWaitForNewClientToConnect(NetworkManager)
    NetcodeIntegrationTest.CreateAndStartNewClient()
    NetcodeIntegrationTest.CreateAndStartNewClientWithTimeTravel()
    NetcodeIntegrationTest.StopOneClient(NetworkManager, bool)
    NetcodeIntegrationTest.StopOneClientWithTimeTravel(NetworkManager, bool)
    NetcodeIntegrationTest.SetTimeTravelSimulatedLatency(float)
    NetcodeIntegrationTest.SetTimeTravelSimulatedDropRate(float)
    NetcodeIntegrationTest.SetTimeTravelSimulatedLatencyJitter(float)
    NetcodeIntegrationTest.CreateServerAndClients(int)
    NetcodeIntegrationTest.CanStartServerAndClients()
    NetcodeIntegrationTest.OnStartedServerAndClients()
    NetcodeIntegrationTest.OnTimeTravelStartedServerAndClients()
    NetcodeIntegrationTest.ClientNetworkManagerPostStartInit()
    NetcodeIntegrationTest.StartServerAndClients()
    NetcodeIntegrationTest.StartServerAndClientsWithTimeTravel()
    NetcodeIntegrationTest.CanClientsLoad()
    NetcodeIntegrationTest.CanClientsUnload()
    NetcodeIntegrationTest.DeRegisterSceneManagerHandler()
    NetcodeIntegrationTest.RegisterSceneManagerHandler()
    NetcodeIntegrationTest.OnCanSceneCleanUpUnload(Scene)
    NetcodeIntegrationTest.ShutdownAndCleanUp()
    NetcodeIntegrationTest.TearDown()
    NetcodeIntegrationTest.OneTimeTearDown()
    NetcodeIntegrationTest.CanDestroyNetworkObject(NetworkObject)
    NetcodeIntegrationTest.DestroySceneNetworkObjects()
    NetcodeIntegrationTest.EnableMessageLogging()
    NetcodeIntegrationTest.WaitForConditionOrTimeOut(Func<bool>, TimeoutHelper)
    NetcodeIntegrationTest.WaitForConditionOrTimeOutWithTimeTravel(Func<bool>, int)
    NetcodeIntegrationTest.WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper)
    NetcodeIntegrationTest.WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int)
    NetcodeIntegrationTest.WaitForClientsConnectedOrTimeOut(NetworkManager[])
    NetcodeIntegrationTest.WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[])
    NetcodeIntegrationTest.WaitForClientsConnectedOrTimeOut()
    NetcodeIntegrationTest.WaitForClientsConnectedOrTimeOutWithTimeTravel()
    NetcodeIntegrationTest.CreateNetworkObjectPrefab(string)
    NetcodeIntegrationTest.SpawnObject(GameObject, NetworkManager, bool)
    NetcodeIntegrationTest.SpawnObjects(GameObject, NetworkManager, int, bool)
    NetcodeIntegrationTest.AssertOnTimeout(string, TimeoutHelper)
    NetcodeIntegrationTest.WaitForTicks(NetworkManager, int)
    NetcodeIntegrationTest.TimeTravel(double, int)
    NetcodeIntegrationTest.GetTickRate()
    NetcodeIntegrationTest.GetFrameRate()
    NetcodeIntegrationTest.ConfigureFramesPerTick()
    NetcodeIntegrationTest.TimeTravelAdvanceTick()
    NetcodeIntegrationTest.TimeTravelToNextTick()
    NetcodeIntegrationTest.SimulateOneFrame()
    NetcodeIntegrationTest.TotalClients
    NetcodeIntegrationTest.m_EnableVerboseDebug
    NetcodeIntegrationTest.m_BypassConnectionTimeout
    NetcodeIntegrationTest.m_EnableTimeTravel
    NetcodeIntegrationTest.m_SetupIsACoroutine
    NetcodeIntegrationTest.m_TearDownIsACoroutine
    NetcodeIntegrationTest.LogAllMessages
    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 NetworkTransformBase : IntegrationTestWithApproximation

    Constructors

    NetworkTransformBase(HostOrServer, Authority, RotationCompression, Rotation, Precision)

    Constructor

    Declaration
    public NetworkTransformBase(NetcodeIntegrationTest.HostOrServer testWithHost, NetworkTransformBase.Authority authority, NetworkTransformBase.RotationCompression rotationCompression, NetworkTransformBase.Rotation rotation, NetworkTransformBase.Precision precision)
    Parameters
    Type Name Description
    NetcodeIntegrationTest.HostOrServer testWithHost

    Determines if we are running as a server or host

    NetworkTransformBase.Authority authority

    Determines if we are using server or owner authority

    NetworkTransformBase.RotationCompression rotationCompression
    NetworkTransformBase.Rotation rotation
    NetworkTransformBase.Precision precision

    Fields

    k_HalfPrecisionPosScale

    Declaration
    protected const float k_HalfPrecisionPosScale = 0.115
    Field Value
    Type Description
    float

    k_HalfPrecisionRot

    Declaration
    protected const float k_HalfPrecisionRot = 0.725
    Field Value
    Type Description
    float

    k_PositionRotationScaleIterations

    Declaration
    protected const int k_PositionRotationScaleIterations = 3
    Field Value
    Type Description
    int

    k_PositionRotationScaleIterations3Axis

    Declaration
    protected const int k_PositionRotationScaleIterations3Axis = 8
    Field Value
    Type Description
    int

    m_AuthoritativePlayer

    Declaration
    protected NetworkObject m_AuthoritativePlayer
    Field Value
    Type Description
    NetworkObject

    m_AuthoritativeTransform

    Declaration
    protected NetworkTransformTestComponent m_AuthoritativeTransform
    Field Value
    Type Description
    NetworkTransformTestComponent

    m_Authority

    Declaration
    protected NetworkTransformBase.Authority m_Authority
    Field Value
    Type Description
    NetworkTransformBase.Authority

    m_AuthorityChildNetworkTransform

    Declaration
    protected ChildObjectComponent m_AuthorityChildNetworkTransform
    Field Value
    Type Description
    ChildObjectComponent

    m_AuthorityChildObject

    Declaration
    protected NetworkObject m_AuthorityChildObject
    Field Value
    Type Description
    NetworkObject

    m_AuthorityParentNetworkTransform

    Declaration
    protected NetworkTransformTestComponent m_AuthorityParentNetworkTransform
    Field Value
    Type Description
    NetworkTransformTestComponent

    m_AuthorityParentObject

    Declaration
    protected NetworkObject m_AuthorityParentObject
    Field Value
    Type Description
    NetworkObject

    m_AuthoritySubChildNetworkTransform

    Declaration
    protected ChildObjectComponent m_AuthoritySubChildNetworkTransform
    Field Value
    Type Description
    ChildObjectComponent

    m_AuthoritySubChildObject

    Declaration
    protected NetworkObject m_AuthoritySubChildObject
    Field Value
    Type Description
    NetworkObject

    m_AxisExcluded

    Declaration
    protected bool m_AxisExcluded
    Field Value
    Type Description
    bool

    m_ChildObject

    Declaration
    protected NetworkObject m_ChildObject
    Field Value
    Type Description
    NetworkObject

    m_ChildObjectLocalPosition

    Declaration
    protected Vector3 m_ChildObjectLocalPosition
    Field Value
    Type Description
    Vector3

    m_ChildObjectLocalRotation

    Declaration
    protected Vector3 m_ChildObjectLocalRotation
    Field Value
    Type Description
    Vector3

    m_ChildObjectLocalScale

    Declaration
    protected Vector3 m_ChildObjectLocalScale
    Field Value
    Type Description
    Vector3

    m_CurrentAxis

    Declaration
    protected NetworkTransformBase.Axis m_CurrentAxis
    Field Value
    Type Description
    NetworkTransformBase.Axis

    m_CurrentHalfPrecision

    Declaration
    protected float m_CurrentHalfPrecision
    Field Value
    Type Description
    float

    m_DetectedPotentialInterpolatedTeleport

    Declaration
    protected float m_DetectedPotentialInterpolatedTeleport
    Field Value
    Type Description
    float

    m_InfoMessage

    Declaration
    protected StringBuilder m_InfoMessage
    Field Value
    Type Description
    StringBuilder

    m_NonAuthoritativePlayer

    Declaration
    protected NetworkObject m_NonAuthoritativePlayer
    Field Value
    Type Description
    NetworkObject

    m_NonAuthoritativeTransform

    Declaration
    protected NetworkTransformTestComponent m_NonAuthoritativeTransform
    Field Value
    Type Description
    NetworkTransformTestComponent

    m_OriginalTargetFrameRate

    Declaration
    protected int m_OriginalTargetFrameRate
    Field Value
    Type Description
    int

    m_OwnerTransform

    Declaration
    protected NetworkTransformTestComponent m_OwnerTransform
    Field Value
    Type Description
    NetworkTransformTestComponent

    m_ParentObject

    Declaration
    protected NetworkObject m_ParentObject
    Field Value
    Type Description
    NetworkObject

    m_Precision

    Declaration
    protected NetworkTransformBase.Precision m_Precision
    Field Value
    Type Description
    NetworkTransformBase.Precision

    m_Rotation

    Declaration
    protected NetworkTransformBase.Rotation m_Rotation
    Field Value
    Type Description
    NetworkTransformBase.Rotation

    m_RotationCompression

    Declaration
    protected NetworkTransformBase.RotationCompression m_RotationCompression
    Field Value
    Type Description
    NetworkTransformBase.RotationCompression

    m_SubChildObject

    Declaration
    protected NetworkObject m_SubChildObject
    Field Value
    Type Description
    NetworkObject

    m_SubChildObjectLocalPosition

    Declaration
    protected Vector3 m_SubChildObjectLocalPosition
    Field Value
    Type Description
    Vector3

    m_SubChildObjectLocalRotation

    Declaration
    protected Vector3 m_SubChildObjectLocalRotation
    Field Value
    Type Description
    Vector3

    m_SubChildObjectLocalScale

    Declaration
    protected Vector3 m_SubChildObjectLocalScale
    Field Value
    Type Description
    Vector3

    Properties

    NumberOfClients

    Declaration
    protected override int NumberOfClients { get; }
    Property Value
    Type Description
    int
    Overrides
    NetcodeIntegrationTest.NumberOfClients

    Methods

    AllChildObjectInstancesAreSpawned()

    Returns true when the server-host and all clients have instantiated the child object to be used in NetworkTransformParentingLocalSpaceOffsetTests

    Declaration
    protected bool AllChildObjectInstancesAreSpawned()
    Returns
    Type Description
    bool

    AllChildObjectInstancesHaveChild()

    Declaration
    protected bool AllChildObjectInstancesHaveChild()
    Returns
    Type Description
    bool

    AllInstancesKeptLocalTransformValues(bool)

    A wait condition specific method that assures the local space coordinates are not impacted by NetworkTransform when parented.

    Declaration
    protected bool AllInstancesKeptLocalTransformValues(bool useSubChild)
    Parameters
    Type Name Description
    bool useSubChild
    Returns
    Type Description
    bool

    GetDeltaVarianceThreshold()

    Declaration
    protected override float GetDeltaVarianceThreshold()
    Returns
    Type Description
    float
    Overrides
    IntegrationTestWithApproximation.GetDeltaVarianceThreshold()

    MoveRotateAndScaleAuthority(Vector3, Vector3, Vector3, OverrideState)

    Validates that moving, rotating, and scaling the authority side with a single tick will properly synchronize the non-authoritative side with the same values.

    Declaration
    protected void MoveRotateAndScaleAuthority(Vector3 position, Vector3 rotation, Vector3 scale, NetworkTransformBase.OverrideState overrideState)
    Parameters
    Type Name Description
    Vector3 position
    Vector3 rotation
    Vector3 scale
    NetworkTransformBase.OverrideState overrideState

    OnClientsAndServerConnectedSetup()

    Declaration
    protected virtual void OnClientsAndServerConnectedSetup()

    OnCreatePlayerPrefab()

    Declaration
    protected override void OnCreatePlayerPrefab()
    Overrides
    NetcodeIntegrationTest.OnCreatePlayerPrefab()

    OnInlineSetup()

    Handles the Setup for time travel enabled child derived tests

    Declaration
    protected override void OnInlineSetup()
    Overrides
    NetcodeIntegrationTest.OnInlineSetup()

    OnInlineTearDown()

    Handles the Teardown for time travel enabled child derived tests

    Declaration
    protected override void OnInlineTearDown()
    Overrides
    NetcodeIntegrationTest.OnInlineTearDown()

    OnNewClientCreated(NetworkManager)

    Handles setting a new client being connected

    Declaration
    protected override void OnNewClientCreated(NetworkManager networkManager)
    Parameters
    Type Name Description
    NetworkManager networkManager
    Overrides
    NetcodeIntegrationTest.OnNewClientCreated(NetworkManager)

    OnNumberOfClients()

    Override to provide the number of clients

    Declaration
    protected virtual int OnNumberOfClients()
    Returns
    Type Description
    int

    OnOneTimeSetup()

    Declaration
    protected override void OnOneTimeSetup()
    Overrides
    NetcodeIntegrationTest.OnOneTimeSetup()

    OnOneTimeTearDown()

    Declaration
    protected override void OnOneTimeTearDown()
    Overrides
    NetcodeIntegrationTest.OnOneTimeTearDown()

    OnServerAndClientsConnected()

    Handles the OnServerAndClientsConnected for coroutine based derived tests

    Declaration
    protected override IEnumerator OnServerAndClientsConnected()
    Returns
    Type Description
    IEnumerator
    Overrides
    NetcodeIntegrationTest.OnServerAndClientsConnected()

    OnServerAndClientsCreated()

    Declaration
    protected override void OnServerAndClientsCreated()
    Overrides
    NetcodeIntegrationTest.OnServerAndClientsCreated()

    OnSetup()

    Handles the Setup for coroutine based derived tests

    Declaration
    protected override IEnumerator OnSetup()
    Returns
    Type Description
    IEnumerator
    Overrides
    NetcodeIntegrationTest.OnSetup()

    OnTearDown()

    Handles the Teardown for coroutine based derived tests

    Declaration
    protected override IEnumerator OnTearDown()
    Returns
    Type Description
    IEnumerator
    Overrides
    NetcodeIntegrationTest.OnTearDown()

    OnTimeTravelServerAndClientsConnected()

    Declaration
    protected override void OnTimeTravelServerAndClientsConnected()
    Overrides
    NetcodeIntegrationTest.OnTimeTravelServerAndClientsConnected()

    PositionRotationScaleMatches()

    Declaration
    protected bool PositionRotationScaleMatches()
    Returns
    Type Description
    bool

    PositionRotationScaleMatches(Vector3, Vector3, Vector3)

    Declaration
    protected bool PositionRotationScaleMatches(Vector3 position, Vector3 eulerRotation, Vector3 scale)
    Parameters
    Type Name Description
    Vector3 position
    Vector3 eulerRotation
    Vector3 scale
    Returns
    Type Description
    bool

    PositionsMatch(bool)

    Declaration
    protected bool PositionsMatch(bool printDeltas = false)
    Parameters
    Type Name Description
    bool printDeltas
    Returns
    Type Description
    bool

    PositionsMatchesValue(Vector3)

    Declaration
    protected bool PositionsMatchesValue(Vector3 positionToMatch)
    Parameters
    Type Name Description
    Vector3 positionToMatch
    Returns
    Type Description
    bool

    PostAllChildrenLocalTransformValuesMatch(bool)

    Declaration
    protected bool PostAllChildrenLocalTransformValuesMatch(bool useSubChild)
    Parameters
    Type Name Description
    bool useSubChild
    Returns
    Type Description
    bool

    RandomlyExcludeAxis(Vector3)

    Randomly determine if an axis should be excluded. If so, then randomly pick one of the axis to be excluded.

    Declaration
    protected Vector3 RandomlyExcludeAxis(Vector3 delta)
    Parameters
    Type Name Description
    Vector3 delta
    Returns
    Type Description
    Vector3

    RotationMatchesValue(Vector3)

    Declaration
    protected bool RotationMatchesValue(Vector3 rotationEulerToMatch)
    Parameters
    Type Name Description
    Vector3 rotationEulerToMatch
    Returns
    Type Description
    bool

    RotationsMatch(bool)

    Declaration
    protected bool RotationsMatch(bool printDeltas = false)
    Parameters
    Type Name Description
    bool printDeltas
    Returns
    Type Description
    bool

    ScaleMatchesValue(Vector3)

    Declaration
    protected bool ScaleMatchesValue(Vector3 scaleToMatch)
    Parameters
    Type Name Description
    Vector3 scaleToMatch
    Returns
    Type Description
    bool

    ScaleValuesMatch(bool)

    Declaration
    protected bool ScaleValuesMatch(bool printDeltas = false)
    Parameters
    Type Name Description
    bool printDeltas
    Returns
    Type Description
    bool

    Setup()

    Declaration
    protected virtual void Setup()

    TargetFrameRate()

    Declaration
    protected virtual int TargetFrameRate()
    Returns
    Type Description
    int

    Teardown()

    Declaration
    protected virtual void Teardown()

    TeleportPositionMatches(Vector3)

    Declaration
    protected bool TeleportPositionMatches(Vector3 nonAuthorityOriginalPosition)
    Parameters
    Type Name Description
    Vector3 nonAuthorityOriginalPosition
    Returns
    Type Description
    bool

    UseUnreliableDeltas()

    Determines whether the test will use unreliable delivery for implicit state updates or not

    Declaration
    protected virtual bool UseUnreliableDeltas()
    Returns
    Type Description
    bool
    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)