Class NetworkScenarioTask
Base class to use network scenarios with asynchronous Tasks.
Inherited Members
Namespace: Unity.Multiplayer.Tools.NetworkSimulator.Runtime
Syntax
public abstract class NetworkScenarioTask : NetworkScenario
Methods
Dispose()
Disposes the scenario.
Declaration
public override void Dispose()
Overrides
Run(INetworkEventsApi, CancellationToken)
Starts running the underlying network scenario. Make sure to handle when IsPaused and the cancellation token.
Declaration
protected abstract Task Run(INetworkEventsApi networkEventsApi, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| INetworkEventsApi | networkEventsApi | API to trigger network simulation events. |
| CancellationToken | cancellationToken | Cancellation token to handle cancellation requests to the underlying task. |
Returns
| Type | Description |
|---|---|
| Task | Task simulating the scenario |
Start(INetworkEventsApi)
Starts running the underlying network scenario.
Declaration
public override void Start(INetworkEventsApi networkEventsApi)
Parameters
| Type | Name | Description |
|---|---|---|
| INetworkEventsApi | networkEventsApi | API to trigger network simulation events. |