Class NetworkScenario
Base class to implement network scenarios, used to start, pause, and resume their behavior at runtime.
Inherited Members
Namespace: Unity.Multiplayer.Tools.NetworkSimulator.Runtime
Syntax
[Serializable]
public abstract class NetworkScenario
Remarks
This base class should be used for custom scenarios. If an frame update is desired, NetworkScenarioBehaviour instead. If an asynchronous task-based implementation is desired, NetworkScenarioTask instead.
Properties
IsPaused
Pause state of the scenario. Returns true when the scenario is paused, false otherwise. Set to true to pause, set to false when paused to resume.
Declaration
public bool IsPaused { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Dispose()
Disposes the scenario.
Declaration
public virtual void Dispose()
OnPause()
Implement to define custom behaviour to be called when the scenario is paused.
Declaration
protected virtual void OnPause()
OnResume()
Implement to define custom behaviour to be called when the scenario is resumed.
Declaration
protected virtual void OnResume()
Start(INetworkEventsApi)
Starts running the underlying network scenario.
Declaration
public abstract void Start(INetworkEventsApi networkEventsApi)
Parameters
Type | Name | Description |
---|---|---|
INetworkEventsApi | networkEventsApi | API to trigger network simulation events. |