Class NetworkTransformTests
Integration tests for NetworkTransform that will test both server and host operating modes and will test both authoritative models for each operating mode.
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: solution.dll
Syntax
public class NetworkTransformTests : IntegrationTestWithApproximation
Constructors
Name | Description |
---|---|
Network |
Constructor |
Properties
Name | Description |
---|---|
Number |
|
m_Enable |
Enables "Time Travel" within the test, which swaps the time provider for the SDK from Unity's
Time class to Mock This enables five important things that help with both performance and determinism of tests that involve a lot of time and waiting:
When time travel is enabled, the following methods become available: Time When time travel is enabled, Netcode Additionally, the following methods replace their non-time-travel equivalents with variants that are not coroutines:
On Note that all of the non-time travel functions can still be used even when time travel is enabled - this is
sometimes needed for, e.g., testing NetworkAnimator, where the unity update loop needs to run to process animations.
However, it's VERY important to note here that, because the SDK will not be operating based on real-world time
but based on the frozen time that's locked in from MockTimeProvider, actions that pass 10 seconds apart by
real-world clock time will be perceived by the SDK as having happened simultaneously if you don't call
Time |
m_Setup |
If this is false, SetUp will call OnInlineSetUp instead of OnSetUp. This is a performance advantage when not using the coroutine functionality, as a coroutine that has no yield instructions in it will nonetheless still result in delaying the continuation of the method that called it for a full frame after it returns. |
m_Tear |
If this is false, TearDown will call OnInlineTearDown instead of OnTearDown. This is a performance advantage when not using the coroutine functionality, as a coroutine that has no yield instructions in it will nonetheless still result in delaying the continuation of the method that called it for a full frame after it returns. |
Methods
Name | Description |
---|---|
Get |
|
Late |
Checks scale of a late joining client for all instances of the late joining client's player |
Network |
|
Non |
This test validates the Set
|
On |
Override this to add components or adjustments to the default player prefab
m_Player |
On |
Called before creating and starting the server and clients
Note: For All |
On |
|
On |
CreateAndStartNewClient Only Invoked when the newly created client has been created |
On |
|
On |
Override this method to do handle cleaning up once the test(s)
within the child derived class have completed
Note: For All |
On |
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. |
On |
Invoked after the server and clients have started and verified their connections with each other. |
Parented |
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. |
Teleport |
The tests teleporting with and without interpolation |
Test |
Tests changing all axial values one at a time. These tests are performed:
|
Test |
Test to make sure that the bitset value is updated properly |
Test |
Validates that rotation checks don't produce false positive results when rolling over between 0 and 360 degrees |
Verify |
Test to verify nonAuthority cannot change the transform directly |