Skip to main content

Unity.Multiplayer.Tools.NetworkSimulator.Runtime.NetworkSimulatorPresetAsset

ScriptableObject used to store the parameters to configure and simulate network conditions.

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Implements#

INetworkSimulatorPreset

Namespace: System.Dynamic.ExpandoObject#
Assembly: Tools.dll#
Syntax#
public class NetworkSimulatorPresetAsset : ScriptableObject, INetworkSimulatorPreset

Properties#

Description#

Optional description of the configuration.

Declaration#

public string Description { get; set; }

Property Value#

TypeDescription
System.String

Name#

Network simulation configuration name.

Declaration#

public string Name { get; set; }

Property Value#

TypeDescription
System.String

PacketDelayMs#

Value for the delay between packet in milliseconds.

Declaration#

public int PacketDelayMs { get; set; }

Property Value#

TypeDescription
System.Int32

PacketJitterMs#

Value for the network jitter (variance) in milliseconds.

Declaration#

public int PacketJitterMs { get; set; }

Property Value#

TypeDescription
System.Int32

PacketLossInterval#

Value for at which interval packet are dropped This value is a drop every X packet, not in time.

Declaration#

public int PacketLossInterval { get; set; }

Property Value#

TypeDescription
System.Int32

PacketLossPercent#

Value for the average percentage of packet are dropped.

Declaration#

public int PacketLossPercent { get; set; }

Property Value#

TypeDescription
System.Int32

Methods#

Create(String, String, Int32, Int32, Int32, Int32)#

Utility function to create a configuration at runtime.

Declaration#

public static NetworkSimulatorPresetAsset Create(string name, string description = "", int packetDelayMs = 0, int packetJitterMs = 0, int packetLossInterval = 0, int packetLossPercent = 0)

Parameters#

TypeNameDescription
System.StringnameName of the configuration.
System.StringdescriptionDescription of the configuration.
System.Int32packetDelayMsValue for the packet delay in milliseconds.
System.Int32packetJitterMsValue for the network jitter in milliseconds.
System.Int32packetLossIntervalValue for the packet loss interval.
System.Int32packetLossPercentValue for the packet loss percentage.

Returns#

TypeDescription
NetworkSimulatorPresetAssetA valid simulation configuration.

Implements#

INetworkSimulatorPreset