Class NetworkObjectOnSpawnTests
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: solution.dll
Syntax
public class NetworkObjectOnSpawnTests : NetcodeIntegrationTest
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
DynamicallySpawnedNoSceneOriginException()
Declaration
public void DynamicallySpawnedNoSceneOriginException()
InstantiateDestroySpawnNotCalled()
Tests that instantiating a NetworkObject and destroying without spawning it does not run OnNetworkSpawn() or OnNetworkSpawn().
Declaration
[UnityTestAttribute]
public IEnumerator InstantiateDestroySpawnNotCalled()
Returns
Type | Description |
---|---|
IEnumerator |
ObserverSpawnTests(ObserverTestTypes, bool)
This test validates SpawnWithObservers property
Declaration
[UnityTestAttribute]
public IEnumerator ObserverSpawnTests(NetworkObjectOnSpawnTests.ObserverTestTypes observerTestTypes, bool sceneManagement)
Parameters
Type | Name | Description |
---|---|---|
NetworkObjectOnSpawnTests.ObserverTestTypes | observerTestTypes | whether to spawn with or without observers |
bool | sceneManagement |
Returns
Type | Description |
---|---|
IEnumerator |
OnCreatePlayerPrefab()
Override this to add components or adjustments to the default player prefab m_PlayerPrefab
Declaration
protected override void OnCreatePlayerPrefab()
Overrides
OnNewClientCreated(NetworkManager)
Assures the ObserverSpawnTests(ObserverTestTypes, bool) late joining client has all NetworkPrefabs required to connect.
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | networkManager |
Overrides
OnServerAndClientsCreated()
This is invoked before the server and client(s) are started. Override this method if you want to make any adjustments to their NetworkManager instances.
Declaration
protected override void OnServerAndClientsCreated()
Overrides
OnTearDown()
Note: For PerTest mode this is called before ShutdownAndCleanUp.
Declaration
protected override IEnumerator OnTearDown()
Returns
Type | Description |
---|---|
IEnumerator |
Overrides
TestOnNetworkSpawnCallbacks()
Test that callbacks are run for playerobject spawn, despawn, regular spawn, destroy on server.
Declaration
[UnityTestAttribute]
public IEnumerator TestOnNetworkSpawnCallbacks()
Returns
Type | Description |
---|---|
IEnumerator |