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 . Client runs it.
- Client destroy spawned => throw exception.
Inheritance
NetworkObjectDestroyTests
Syntax
public class NetworkObjectDestroyTests : NetcodeIntegrationTest
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Overrides
Methods
OnTearDown()
Declaration
protected override IEnumerator OnTearDown()
Returns
Overrides
TestNetworkObjectClientDestroy(NetworkObjectDestroyTests.ClientDestroyObject)
Validates the expected behavior when the client-side destroys a NetworkObject
Declaration
public IEnumerator TestNetworkObjectClientDestroy(NetworkObjectDestroyTests.ClientDestroyObject clientDestroyObject)
Parameters
Returns
TestNetworkObjectServerDestroy()
Tests that a server can destroy a NetworkObject and that it gets despawned correctly.
Declaration
public IEnumerator TestNetworkObjectServerDestroy()
Returns