Class NetworkSimulatorPresetAsset
ScriptableObject used to store the parameters to configure and simulate network conditions.
Inherited Members
Namespace: Unity.Multiplayer.Tools.NetworkSimulator.Runtime
Syntax
[CreateAssetMenu(fileName = "NetworkSimulatorPresetAsset", menuName = "Multiplayer/NetworkSimulatorPresetAsset")]
public class NetworkSimulatorPresetAsset : ScriptableObject, INetworkSimulatorPreset
Properties
Description
Optional description of the configuration.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
String |
Implements
Name
Network simulation configuration name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Implements
PacketDelayMs
Value for the delay between packet in milliseconds.
Declaration
public int PacketDelayMs { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
PacketJitterMs
Value for the network jitter (variance) in milliseconds.
Declaration
public int PacketJitterMs { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
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
Type | Description |
---|---|
Int32 |
Implements
PacketLossPercent
Value for the average percentage of packet are dropped.
Declaration
public int PacketLossPercent { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
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
Type | Name | Description |
---|---|---|
String | name | Name of the configuration. |
String | description | Description of the configuration. |
Int32 | packetDelayMs | Value for the packet delay in milliseconds. |
Int32 | packetJitterMs | Value for the network jitter in milliseconds. |
Int32 | packetLossInterval | Value for the packet loss interval. |
Int32 | packetLossPercent | Value for the packet loss percentage. |
Returns
Type | Description |
---|---|
NetworkSimulatorPresetAsset | A valid simulation configuration. |