docs.unity3d.com
    Show / Hide Table of Contents

    Class NetworkSimulator

    Add this component to any game object to configure network simulation parameters.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    NetworkSimulator
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Multiplayer.Tools.NetworkSimulator.Runtime
    Syntax
    public class NetworkSimulator : MonoBehaviour, INotifyPropertyChanged, INetworkEventsApi

    Fields

    AutoRunScenario

    Allows to determine if network scenarios should start automatically or not.

    Declaration
    [SerializeField]
    public bool AutoRunScenario
    Field Value
    Type Description
    Boolean

    Properties

    ConnectionPreset

    The Connection Preset used to define a set of connection parameters to simulate the network condition at runtime.

    Declaration
    public INetworkSimulatorPreset ConnectionPreset { get; set; }
    Property Value
    Type Description
    INetworkSimulatorPreset

    CurrentPreset

    Returns the current connection preset used to simulate network conditions.

    Declaration
    public INetworkSimulatorPreset CurrentPreset { get; }
    Property Value
    Type Description
    INetworkSimulatorPreset
    Implements
    INetworkEventsApi.CurrentPreset

    IsAvailable

    Returns whether the Network Simulator fulfills all required dependencies and is available to be used.

    Declaration
    public bool IsAvailable { get; }
    Property Value
    Type Description
    Boolean
    Implements
    INetworkEventsApi.IsAvailable

    IsConnected

    Returns true when Network Simulator is connected.

    Declaration
    public bool IsConnected { get; }
    Property Value
    Type Description
    Boolean
    Implements
    INetworkEventsApi.IsConnected

    Scenario

    The Network Scenario used to modify network connection parameters at runtime.

    Declaration
    public NetworkScenario Scenario { get; set; }
    Property Value
    Type Description
    NetworkScenario

    Methods

    ChangeConnectionPreset(INetworkSimulatorPreset)

    Changes the current connection preset used to simulate network condition parameters.

    Declaration
    public void ChangeConnectionPreset(INetworkSimulatorPreset preset)
    Parameters
    Type Name Description
    INetworkSimulatorPreset preset

    The Network Simulator Preset being set.

    Implements
    INetworkEventsApi.ChangeConnectionPreset(INetworkSimulatorPreset)

    Disconnect()

    Simulates a network disconnection.

    Declaration
    public void Disconnect()
    Implements
    INetworkEventsApi.Disconnect()

    Reconnect()

    Reconnects after simulating a network disconnection.

    Declaration
    public void Reconnect()
    Implements
    INetworkEventsApi.Reconnect()

    TriggerLagSpike(TimeSpan)

    Simulates a lag spike for the specified duration.

    Declaration
    public void TriggerLagSpike(TimeSpan duration)
    Parameters
    Type Name Description
    TimeSpan duration

    The duration for which the lag spike shall last.

    Implements
    INetworkEventsApi.TriggerLagSpike(TimeSpan)

    TriggerLagSpikeAsync(TimeSpan)

    Simulates a lag spike for the specified duration.

    Declaration
    public Task TriggerLagSpikeAsync(TimeSpan duration)
    Parameters
    Type Name Description
    TimeSpan duration

    The duration for which the lag spike shall last.

    Returns
    Type Description
    Task

    The task that runs for the duration of the lag spike.

    Implements
    INetworkEventsApi.TriggerLagSpikeAsync(TimeSpan)

    Explicit Interface Implementations

    INotifyPropertyChanged.PropertyChanged

    Declaration
    event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged
    Returns
    Type Description
    PropertyChangedEventHandler
    Implements
    INotifyPropertyChanged.PropertyChanged
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 26 October 2023