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 : NetcodeIntegrationTest
Constructors
Declaration
public NetworkTransformTests(NetcodeIntegrationTest.HostOrServer testWithHost, NetworkTransformTests.Authority authority)
Parameters
Properties
Declaration
protected override int NumberOfClients { get; }
Property Value
Overrides
Methods
This validates that multiple changes can occur within the same tick or over
several ticks while still keeping non-authoritative instances synchronized.
Declaration
public IEnumerator NetworkTransformMultipleChangesOverTime(NetworkTransformTests.TransformSpace testLocalTransform, NetworkTransformTests.OverrideState overideState)
Parameters
Returns
Validates that local space transform values remain the same when a NetworkTransform is
parented under another NetworkTransform
Declaration
public IEnumerator NetworkTransformParentedLocalSpaceTest(NetworkTransformTests.Interpolation interpolation)
Parameters
Returns
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 IEnumerator NonAuthorityOwnerSettingStateTest(NetworkTransformTests.Interpolation interpolation)
Parameters
Returns
Declaration
protected override void OnCreatePlayerPrefab()
Overrides
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
Overrides
Declaration
protected override IEnumerator OnServerAndClientsConnected()
Returns
Overrides
Declaration
protected override void OnServerAndClientsCreated()
Overrides
Declaration
protected override IEnumerator OnSetup()
Returns
Overrides
Declaration
protected override IEnumerator OnTearDown()
Returns
Overrides
The tests teleporting with and without interpolation
Declaration
public IEnumerator TeleportTest(NetworkTransformTests.Interpolation interpolation)
Parameters
Returns
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 IEnumerator TestAuthoritativeTransformChangeOneAtATime(NetworkTransformTests.TransformSpace testLocalTransform, NetworkTransformTests.Interpolation interpolation, NetworkTransformTests.OverrideState overideState)
Parameters
Returns
Test to make sure that the bitset value is updated properly
Declaration
public IEnumerator TestBitsetValue(NetworkTransformTests.Interpolation interpolation)
Parameters
Returns
Validates that rotation checks don't produce false positive
results when rolling over between 0 and 360 degrees
Declaration
public IEnumerator TestRotationThresholdDeltaCheck(NetworkTransformTests.Interpolation interpolation)
Parameters
Returns
Test to verify nonAuthority cannot change the transform directly
Declaration
public IEnumerator VerifyNonAuthorityCantChangeTransform(NetworkTransformTests.Interpolation interpolation)
Parameters
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.