Integration tests for NetworkTransform that will test both
server and host operating modes and will test both authoritative
models for each operating mode.
Inheritance
NetworkTransformTests
public class NetworkTransformTests : IntegrationTestWithApproximation
Constructors
Declaration
public NetworkTransformTests(NetcodeIntegrationTest.HostOrServer testWithHost, NetworkTransformTests.Authority authority)
Parameters
Properties
Declaration
protected override bool m_EnableTimeTravel { get; }
Property Value
Overrides
Declaration
protected override bool m_SetupIsACoroutine { get; }
Property Value
Overrides
Declaration
protected override bool m_TearDownIsACoroutine { get; }
Property Value
Overrides
Declaration
protected override int NumberOfClients { get; }
Property Value
Overrides
Methods
Declaration
protected override float GetDeltaVarianceThreshold()
Returns
Overrides
Checks scale of a late joining client for all instances of the late joining client's player
Declaration
public void LateJoiningPlayerInitialScaleValues(NetworkTransformTests.TransformSpace testLocalTransform, NetworkTransformTests.Interpolation interpolation, NetworkTransformTests.OverrideState overideState)
Parameters
Declaration
public void NetworkTransformMultipleChangesOverTime(NetworkTransformTests.TransformSpace testLocalTransform, NetworkTransformTests.OverrideState overideState, NetworkTransformTests.Precision precision, NetworkTransformTests.Rotation rotationSynch, NetworkTransformTests.Axis axis)
Parameters
This test validates the SetState(Nullable<Vector3>, Nullable<Quaternion>, Nullable<Vector3>, Boolean) method
usage for the non-authoritative side. It will either be the owner or the server making/requesting state changes.
This validates that:
- The owner authoritative mode can still be controlled by the server (i.e. owner authoritative with server authority override capabilities)
- The server authoritative mode can still be directed by the client owner.
Declaration
public void NonAuthorityOwnerSettingStateTest(NetworkTransformTests.Interpolation interpolation)
Parameters
Declaration
protected override void OnCreatePlayerPrefab()
Overrides
Declaration
protected override void OnInlineSetup()
Overrides
Declaration
protected override void OnInlineTearDown()
Overrides
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
Overrides
Declaration
protected override void OnOneTimeSetup()
Overrides
Declaration
protected override void OnOneTimeTearDown()
Overrides
Declaration
protected override void OnServerAndClientsCreated()
Overrides
Declaration
protected override void OnTimeTravelServerAndClientsConnected()
Overrides
Validates that transform values remain the same when a NetworkTransform is
parented under another NetworkTransform under all of the possible axial conditions
as well as when the parent has a varying scale.
Declaration
public void ParentedNetworkTransformTest(NetworkTransformTests.Precision precision, NetworkTransformTests.Rotation rotation, NetworkTransformTests.RotationCompression rotationCompression, NetworkTransformTests.Interpolation interpolation, bool worldPositionStays, float scale)
Parameters
The tests teleporting with and without interpolation
Declaration
public void TeleportTest(NetworkTransformTests.Interpolation interpolation, NetworkTransformTests.Precision precision)
Parameters
Tests changing all axial values one at a time.
These tests are performed:
- While in local space and world space
- While interpolation is enabled and disabled
- Using the TryCommitTransformToServer "override" that can be used
from a child derived or external class.
Declaration
public void TestAuthoritativeTransformChangeOneAtATime(NetworkTransformTests.TransformSpace testLocalTransform, NetworkTransformTests.Interpolation interpolation, NetworkTransformTests.OverrideState overideState)
Parameters
Test to make sure that the bitset value is updated properly
Declaration
public void TestBitsetValue(NetworkTransformTests.Interpolation interpolation)
Parameters
Validates that rotation checks don't produce false positive
results when rolling over between 0 and 360 degrees
Declaration
public void TestRotationThresholdDeltaCheck(NetworkTransformTests.Interpolation interpolation, NetworkTransformTests.Precision precision)
Parameters
Test to verify nonAuthority cannot change the transform directly
Declaration
public void VerifyNonAuthorityCantChangeTransform(NetworkTransformTests.Interpolation interpolation, NetworkTransformTests.Precision precision)
Parameters
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.