Unity.Multiplayer.Tools.NetworkSimulator.Runtime.INetworkEventsApi
API that can be used to inspect the state of the simulated network and trigger events.
#
Namespace: System.Dynamic.ExpandoObject#
Assembly: Tools.dll#
Syntax#
Properties#
CurrentPresetReturns the current connection preset used to simulate network conditions.
#
Declaration#
Property ValueType | Description |
---|---|
INetworkSimulatorPreset |
#
IsAvailableReturns whether the Network Simulator fulfills all required dependencies and is available to be used.
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsConnectedReturns true when Network Simulator is connected.
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
Methods#
ChangeConnectionPreset(INetworkSimulatorPreset)Changes the current connection preset used to simulate network condition parameters.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
INetworkSimulatorPreset | preset | The Network Simulator Preset being set. |
#
Disconnect()Simulates a network disconnection.
#
Declaration#
Reconnect()Reconnects after simulating a network disconnection.
#
Declaration#
TriggerLagSpike(TimeSpan)Simulates a lag spike for the specified duration.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.TimeSpan | duration | The duration for which the lag spike shall last. |
#
TriggerLagSpikeAsync(TimeSpan)Simulates a lag spike for the specified duration.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.TimeSpan | duration | The duration for which the lag spike shall last. |
#
ReturnsType | Description |
---|---|
Task | The task that runs for the duration of the lag spike. |