Class NetworkSimulator
Add this component to any game object to configure network simulation parameters.
Inherited Members
Namespace: Unity.Multiplayer.Tools.NetworkSimulator.Runtime
Assembly: solution.dll
Syntax
[AddComponentMenu("Netcode/Network Simulator")]
public class NetworkSimulator : MonoBehaviour, INotifyPropertyChanged, INetworkEventsApi
Fields
Name | Description |
---|---|
AutoRunScenario | Allows to determine if network scenarios should start automatically or not. |
Properties
Name | Description |
---|---|
ConnectionPreset | The Connection Preset used to define a set of connection parameters to simulate the network condition at runtime. |
CurrentPreset | Returns the current connection preset used to simulate network conditions. |
IsAvailable | Returns whether the underlying network transport is available. |
IsConnected | Returns whether the underlying network transport is connected. |
Scenario | The Network Scenario used to modify network connection parameters at runtime. The new scenario will start automatically under specific circumstances: If autorun is enabled and the application is in playmode and the new scenario is valid (not None/null) and the previous scenario was a running valid one. |
Methods
Name | Description |
---|---|
ChangeConnectionPreset(INetworkSimulatorPreset) | Changes the current connection preset used to simulate network condition parameters. |
Disconnect() | Simulates a network disconnection. |
Reconnect() | Reconnects after simulating a network disconnection. |
TriggerLagSpike(TimeSpan) | Simulates a lag spike for the specified duration. |
TriggerLagSpikeAsync(TimeSpan) | Simulates a lag spike for the specified duration. |