Class NetworkBehaviourGenericTests
This class is for testing general fixes or functionality of NetworkBehaviours
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: solution.dll
Syntax
public class NetworkBehaviourGenericTests : NetcodeIntegrationTest
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
CanStartServerAndClients()
Override this method and return false in order to be able to manually control when the server and clients are started.
Declaration
protected override bool CanStartServerAndClients()
Returns
Type | Description |
---|---|
bool |
Overrides
OnNetworkDespawnInvokedWhenClientDisconnects()
This validates that upon a client disconnecting, the server-side client's player clone will invoke NetworkBehaviour.OnNetworkDespawn when the component precedes the NetworkObject component.(PR-2323)
Declaration
[UnityTestAttribute]
public IEnumerator OnNetworkDespawnInvokedWhenClientDisconnects()
Returns
Type | Description |
---|---|
IEnumerator |
OnPlayerPrefabGameObjectCreated()
Invoked immediately after the player prefab GameObject is created prior to adding a NetworkObject component
Declaration
protected override void OnPlayerPrefabGameObjectCreated()
Overrides
OnSetup()
Called before creating and starting the server and clients Note: For AllTests and PerTest mode integration tests. For those two modes, if you want to have access to the server or client NetworkManagers then override OnServerAndClientsCreated(). m_ServerNetworkManager and m_ClientNetworkManagers
Declaration
protected override IEnumerator OnSetup()
Returns
Type | Description |
---|---|
IEnumerator |
Overrides
ValidateDeleteChildNetworkBehaviour()
This validates the fix for when a child GameObject with a NetworkBehaviour is deleted while the parent GameObject with a NetworkObject is spawned and is not deleted until a later time would cause an exception due to the NetworkBehaviour not being removed from the NetworkObject.ChildNetworkBehaviours list.
Declaration
[UnityTestAttribute]
public IEnumerator ValidateDeleteChildNetworkBehaviour()
Returns
Type | Description |
---|---|
IEnumerator |
ValidateNoSpam()
This test validates a fix to NetworkBehaviour.NetworkObject when the NetworkManager.LogLevel is set to Developer Note: This test does not require any clients, but should not impact this particular test if new tests are added to this class that do require clients
Declaration
[UnityTestAttribute]
public IEnumerator ValidateNoSpam()
Returns
Type | Description |
---|---|
IEnumerator |
ValidatedDisableddNetworkBehaviourWarning()
This validates the fix for when a child GameObject with a NetworkBehaviour is deleted while the parent GameObject with a NetworkObject is spawned and is not deleted until a later time would cause an exception due to the NetworkBehaviour not being removed from the NetworkObject.ChildNetworkBehaviours list.
Declaration
[UnityTestAttribute]
public IEnumerator ValidatedDisableddNetworkBehaviourWarning()
Returns
Type | Description |
---|---|
IEnumerator |