Class NetworkBehaviourPrePostSpawnTests
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
public class NetworkBehaviourPrePostSpawnTests : NetcodeIntegrationTest
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
CanStartServerAndClients()
Override this method and return false in order to be able to manually control when the server and clients are started.
Declaration
protected override bool CanStartServerAndClients()
Returns
Type | Description |
---|---|
bool |
Overrides
OnNetworkPreAndPostSpawn()
This validates that pre spawn can be used to instantiate and assign a NetworkVariable (or other prespawn tasks) which can be useful for assigning a NetworkVariable value on the server side when the NetworkVariable has owner write permissions. This also assures that duruing post spawn all associated NetworkBehaviours have run through the OnNetworkSpawn pass (i.e. OnNetworkSpawn order is not an issue)
Declaration
[UnityTest]
public IEnumerator OnNetworkPreAndPostSpawn()
Returns
Type | Description |
---|---|
IEnumerator |
OnNewClientCreated(NetworkManager)
CreateAndStartNewClient Only Invoked when the newly created client has been created
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
Type | Name | Description |
---|---|---|
Network |
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
OnSetup()
Called before creating and starting the server and clients
Note: For All
Declaration
protected override IEnumerator OnSetup()
Returns
Type | Description |
---|---|
IEnumerator |