Class NetworkTransformBase
Inheritance
NetworkTransformBase
Assembly: Unity.Netcode.RuntimeTests.dll
public class NetworkTransformBase : IntegrationTestWithApproximation
Constructors
Declaration
public NetworkTransformBase(NetcodeIntegrationTest.HostOrServer testWithHost, NetworkTransformBase.Authority authority, NetworkTransformBase.RotationCompression rotationCompression, NetworkTransformBase.Rotation rotation, NetworkTransformBase.Precision precision)
Parameters
Fields
Declaration
protected const float k_HalfPrecisionPosScale = 0.115
Field Value
Declaration
protected const float k_HalfPrecisionRot = 0.725
Field Value
Declaration
protected const int k_PositionRotationScaleIterations = 3
Field Value
Declaration
protected const int k_PositionRotationScaleIterations3Axis = 8
Field Value
Declaration
protected NetworkObject m_AuthoritativePlayer
Field Value
Declaration
protected NetworkTransformTestComponent m_AuthoritativeTransform
Field Value
Declaration
protected NetworkTransformBase.Authority m_Authority
Field Value
Declaration
protected ChildObjectComponent m_AuthorityChildNetworkTransform
Field Value
Declaration
protected NetworkObject m_AuthorityChildObject
Field Value
Declaration
protected NetworkTransformTestComponent m_AuthorityParentNetworkTransform
Field Value
Declaration
protected NetworkObject m_AuthorityParentObject
Field Value
Declaration
protected ChildObjectComponent m_AuthoritySubChildNetworkTransform
Field Value
Declaration
protected NetworkObject m_AuthoritySubChildObject
Field Value
Declaration
protected bool m_AxisExcluded
Field Value
Declaration
protected NetworkObject m_ChildObject
Field Value
Declaration
protected Vector3 m_ChildObjectLocalPosition
Field Value
Declaration
protected Vector3 m_ChildObjectLocalRotation
Field Value
Declaration
protected Vector3 m_ChildObjectLocalScale
Field Value
Declaration
protected NetworkTransformBase.Axis m_CurrentAxis
Field Value
Declaration
protected float m_CurrentHalfPrecision
Field Value
Declaration
protected float m_DetectedPotentialInterpolatedTeleport
Field Value
Declaration
protected StringBuilder m_InfoMessage
Field Value
Declaration
protected NetworkObject m_NonAuthoritativePlayer
Field Value
Declaration
protected NetworkTransformTestComponent m_NonAuthoritativeTransform
Field Value
Declaration
protected int m_OriginalTargetFrameRate
Field Value
Declaration
protected NetworkTransformTestComponent m_OwnerTransform
Field Value
Declaration
protected NetworkObject m_ParentObject
Field Value
Declaration
protected NetworkTransformBase.Precision m_Precision
Field Value
Declaration
protected NetworkTransformBase.Rotation m_Rotation
Field Value
Declaration
protected NetworkTransformBase.RotationCompression m_RotationCompression
Field Value
Declaration
protected NetworkObject m_SubChildObject
Field Value
Declaration
protected Vector3 m_SubChildObjectLocalPosition
Field Value
Declaration
protected Vector3 m_SubChildObjectLocalRotation
Field Value
Declaration
protected Vector3 m_SubChildObjectLocalScale
Field Value
Properties
Declaration
protected override int NumberOfClients { get; }
Property Value
Overrides
Methods
Returns true when the server-host and all clients have
instantiated the child object to be used in NetworkTransformParentingLocalSpaceOffsetTests
Declaration
protected bool AllChildObjectInstancesAreSpawned()
Returns
Declaration
protected bool AllChildObjectInstancesHaveChild()
Returns
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
Declaration
protected override float GetDeltaVarianceThreshold()
Returns
Overrides
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
Declaration
protected virtual void OnClientsAndServerConnectedSetup()
Override this to add components or adjustments to the default player prefab
m_PlayerPrefab
Declaration
protected override void OnCreatePlayerPrefab()
Overrides
Handles the Setup for time travel enabled child derived tests
Declaration
protected override void OnInlineSetup()
Overrides
Handles the Teardown for time travel enabled child derived tests
Declaration
protected override void OnInlineTearDown()
Overrides
Handles setting a new client being connected
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
Overrides
Override to provide the number of clients
Declaration
protected virtual int OnNumberOfClients()
Returns
Declaration
protected override void OnOneTimeSetup()
Overrides
Override this method to do handle cleaning up once the test(s)
within the child derived class have completed
Note: For AllTests mode
this is called before ShutdownAndCleanUp.
Declaration
protected override void OnOneTimeTearDown()
Overrides
Handles the OnServerAndClientsConnected for coroutine based derived tests
Declaration
protected override IEnumerator OnServerAndClientsConnected()
Returns
Overrides
This is invoked before the server and client(s) are started.
Override this method if you want to make any adjustments to their
NetworkManager instances.
Declaration
protected override void OnServerAndClientsCreated()
Overrides
Handles the Setup for coroutine based derived tests
Declaration
protected override IEnumerator OnSetup()
Returns
Overrides
Handles the Teardown for coroutine based derived tests
Declaration
protected override IEnumerator OnTearDown()
Returns
Overrides
Invoked after the server and clients have started and verified
their connections with each other.
Declaration
protected override void OnTimeTravelServerAndClientsConnected()
Overrides
Declaration
protected bool PositionRotationScaleMatches()
Returns
Declaration
protected bool PositionRotationScaleMatches(Vector3 position, Vector3 eulerRotation, Vector3 scale)
Parameters
Returns
Declaration
protected bool PositionsMatch(bool printDeltas = false)
Parameters
Type |
Name |
Description |
bool |
printDeltas |
|
Returns
Declaration
protected bool PositionsMatchesValue(Vector3 positionToMatch)
Parameters
Type |
Name |
Description |
Vector3 |
positionToMatch |
|
Returns
PostAllChildrenLocalTransformValuesMatch(bool)
Declaration
protected bool PostAllChildrenLocalTransformValuesMatch(bool useSubChild)
Parameters
Type |
Name |
Description |
bool |
useSubChild |
|
Returns
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
Declaration
protected bool RotationMatchesValue(Vector3 rotationEulerToMatch)
Parameters
Type |
Name |
Description |
Vector3 |
rotationEulerToMatch |
|
Returns
Declaration
protected bool RotationsMatch(bool printDeltas = false)
Parameters
Type |
Name |
Description |
bool |
printDeltas |
|
Returns
Declaration
protected bool ScaleMatchesValue(Vector3 scaleToMatch)
Parameters
Type |
Name |
Description |
Vector3 |
scaleToMatch |
|
Returns
Declaration
protected bool ScaleValuesMatch(bool printDeltas = false)
Parameters
Type |
Name |
Description |
bool |
printDeltas |
|
Returns
Declaration
protected virtual void Setup()
Declaration
protected virtual int TargetFrameRate()
Returns
Declaration
protected virtual void Teardown()
Declaration
protected bool TeleportPositionMatches(Vector3 nonAuthorityOriginalPosition)
Parameters
Type |
Name |
Description |
Vector3 |
nonAuthorityOriginalPosition |
|
Returns
Determines whether the test will use unreliable delivery for implicit state updates or not
Declaration
protected virtual bool UseUnreliableDeltas()
Returns
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.