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.
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Syntax
public class NetworkObjectDestroyTests : NetcodeIntegrationTest
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
Methods
TestNetworkObjectClientDestroy()
Tests that a client cannot destroy a spawned networkobject.
Declaration
public IEnumerator TestNetworkObjectClientDestroy()
Returns
Type | Description |
---|---|
IEnumerator |
TestNetworkObjectServerDestroy()
Tests that a server can destroy a NetworkObject and that it gets despawned correctly.
Declaration
public IEnumerator TestNetworkObjectServerDestroy()
Returns
Type | Description |
---|---|
IEnumerator |