Class NetworkObjectSynchronizationTests
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
[TestFixture(new object[] { NetworkObjectSynchronizationTests.VariableLengthSafety.DisableNetVarSafety, NetcodeIntegrationTest.HostOrServer.Host })]
[TestFixture(new object[] { NetworkObjectSynchronizationTests.VariableLengthSafety.EnabledNetVarSafety, NetcodeIntegrationTest.HostOrServer.Host })]
[TestFixture(new object[] { NetworkObjectSynchronizationTests.VariableLengthSafety.DisableNetVarSafety, NetcodeIntegrationTest.HostOrServer.Server })]
[TestFixture(new object[] { NetworkObjectSynchronizationTests.VariableLengthSafety.EnabledNetVarSafety, NetcodeIntegrationTest.HostOrServer.Server })]
public class NetworkObjectSynchronizationTests : NetcodeIntegrationTest
Constructors
NetworkObjectSynchronizationTests(VariableLengthSafety, HostOrServer)
Declaration
public NetworkObjectSynchronizationTests(NetworkObjectSynchronizationTests.VariableLengthSafety variableLengthSafety, NetcodeIntegrationTest.HostOrServer hostOrServer)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkObjectSynchronizationTests.VariableLengthSafety | variableLengthSafety | |
| NetcodeIntegrationTest.HostOrServer | hostOrServer |
Properties
NumberOfClients
Gets the number of clients to be created for the integration test.
Declaration
protected override int NumberOfClients { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
NetworkBehaviourOnSynchronize()
A basic validation for the NetworkBehaviour.OnSynchronize method
Declaration
[UnityTest]
public IEnumerator NetworkBehaviourOnSynchronize()
Returns
| Type | Description |
|---|---|
| IEnumerator |
NetworkBehaviourSynchronization()
This validates that when a NetworkBehaviour fails serialization or deserialization during synchronizations that other NetworkBehaviours will still be initialized properly
Declaration
[UnityTest]
public IEnumerator NetworkBehaviourSynchronization()
Returns
| Type | Description |
|---|---|
| IEnumerator |
NetworkObjectDeserializationFailure()
Declaration
[UnityTest]
public IEnumerator NetworkObjectDeserializationFailure()
Returns
| Type | Description |
|---|---|
| IEnumerator |
OnCreatePlayerPrefab()
Override this to add components or adjustments to the default player prefab m_PlayerPrefab
Declaration
protected override void OnCreatePlayerPrefab()
Overrides
OnNewClientCreated(NetworkManager)
Invoked when a new client has been created during the integration test. Override this method to perform any setup or configuration needed for the new client before it is started.
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkManager | networkManager | The NetworkManager instance of the client. |
Overrides
OnServerAndClientsCreated()
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()