docs.unity3d.com
    Show / Hide Table of Contents

    Class NetworkScenarioTask

    Base class to use network scenarios with asynchronous Tasks.

    Inheritance
    Object
    NetworkScenario
    NetworkScenarioTask
    ConnectionsCycle
    RandomConnectionsSwap
    Inherited Members
    NetworkScenario.IsPaused
    NetworkScenario.OnPause()
    NetworkScenario.OnResume()
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Multiplayer.Tools.NetworkSimulator.Runtime
    Syntax
    public abstract class NetworkScenarioTask : NetworkScenario

    Methods

    Dispose()

    Disposes the scenario.

    Declaration
    public override void Dispose()
    Overrides
    NetworkScenario.Dispose()

    Run(INetworkEventsApi, CancellationToken)

    Starts running the underlying network scenario. Make sure to handle when IsPaused and the cancellation token.

    Declaration
    protected abstract Task Run(INetworkEventsApi networkEventsApi, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    INetworkEventsApi networkEventsApi

    API to trigger network simulation events.

    CancellationToken cancellationToken

    Cancellation token to handle cancellation requests to the underlying task.

    Returns
    Type Description
    Task

    Task simulating the scenario

    Start(INetworkEventsApi)

    Starts running the underlying network scenario.

    Declaration
    public override void Start(INetworkEventsApi networkEventsApi)
    Parameters
    Type Name Description
    INetworkEventsApi networkEventsApi

    API to trigger network simulation events.

    Overrides
    NetworkScenario.Start(INetworkEventsApi)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 26 October 2023