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.
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: solution.dll
Syntax
public class NetworkObjectDestroyTests : NetcodeIntegrationTest
Properties
| Name | Description |
|---|---|
| NumberOfClients |
Methods
| Name | Description |
|---|---|
| OnTearDown() | Note: For PerTest mode this is called before ShutdownAndCleanUp. |
| TestNetworkObjectClientDestroy(ClientDestroyObject) | Validates the expected behavior when the client-side destroys a NetworkObject |
| TestNetworkObjectServerDestroy() | Tests that a server can destroy a NetworkObject and that it gets despawned correctly. |