Class NetworkObjectDestroyTests
Tests calling destroy on spawned / unspawned NetworkObjects. Expected behavior:
- Server or client destroy on unspawned => Object gets destroyed, no exceptions
- Server destroy spawned => Object gets destroyed and despawned/destroyed on all clients. Server does not run NetworkPrefaInstanceHandler.HandleNetworkPrefabDestroy. Client runs it.
- Client destroy spawned => throw exception.
Inheritance
NetworkObjectDestroyTests
Assembly: solution.dll
Syntax
public class NetworkObjectDestroyTests : NetcodeIntegrationTest
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Overrides
Methods
OnTearDown()
Note: For PerTest mode
this is called before ShutdownAndCleanUp.
Declaration
protected override IEnumerator OnTearDown()
Returns
Overrides
TestNetworkObjectClientDestroy(ClientDestroyObject)
Validates the expected behavior when the client-side destroys a NetworkObject
Declaration
[UnityTestAttribute]
public IEnumerator TestNetworkObjectClientDestroy(NetworkObjectDestroyTests.ClientDestroyObject clientDestroyObject)
Parameters
Returns
TestNetworkObjectServerDestroy()
Tests that a server can destroy a NetworkObject and that it gets despawned correctly.
Declaration
[UnityTestAttribute]
public IEnumerator TestNetworkObjectServerDestroy()
Returns