docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Dispatcher

    Dispatch execution to the main thread.

    Inheritance
    object
    Dispatcher
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.UnitySDK
    Assembly: Unity.Pixyz.UnitySDK.Editor.dll
    Syntax
    public static class Dispatcher

    Methods

    DelayFrames(int)

    Delay frames and dispatch execution to the main thread

    Declaration
    public static Dispatcher.DelayFramesDispatch DelayFrames(int frames)
    Parameters
    Type Name Description
    int frames

    number of frames to delay

    Returns
    Type Description
    Dispatcher.DelayFramesDispatch

    Dispatch

    GoMainThread()

    Dispatch execution to the main thread.

    Declaration
    public static Dispatcher.GoMainThreadDispatch GoMainThread()
    Returns
    Type Description
    Dispatcher.GoMainThreadDispatch

    Dispatch

    GoThreadPool()

    Delay frames and dispatch execution to the main thread

    Declaration
    public static Dispatcher.GoThreadPoolDispatch GoThreadPool()
    Returns
    Type Description
    Dispatcher.GoThreadPoolDispatch

    Dispatch

    SleepForSeconds(float)

    Delay frames and dispatch execution to the main thread

    Declaration
    public static Dispatcher.SleepForSecondsDispatch SleepForSeconds(float seconds)
    Parameters
    Type Name Description
    float seconds

    Number of seconds to sleep

    Returns
    Type Description
    Dispatcher.SleepForSecondsDispatch

    Dispatch

    StartCoroutine(IEnumerator)

    Starts a coroutine. Similar to Unity's coroutine, except that it can switch threads. Yield instructions to use are all static methods in the Dispatcher class.

    Declaration
    public static void StartCoroutine(IEnumerator enumerable)
    Parameters
    Type Name Description
    IEnumerator enumerable

    Instruction to run

    Update()

    Update callback, connected to editor loop and game loop, in order to be able to dispatch instructions in the main thread in editor or play mode.

    Declaration
    public static void Update()

    WaitForSeconds(float)

    Delay frames and dispatch execution to the main thread

    Declaration
    public static Dispatcher.WaitForSecondsDispatch WaitForSeconds(float seconds)
    Parameters
    Type Name Description
    float seconds

    Number of seconds to wait

    Returns
    Type Description
    Dispatcher.WaitForSecondsDispatch

    Dispatch

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)