docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Looper

    An object that contains its own message queue and its own running loop for dequeuing messages to pass them to Handler targets.

    Inheritance
    object
    Looper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Core
    Assembly: Unity.AppUI.dll
    Syntax
    public class Looper

    Constructors

    Looper()

    Default constructor.

    Declaration
    public Looper()

    Looper(IVisualElementScheduler)

    Default constructor using the Unity UI-Toolkit VisualElement scheduler to run the loop.

    Declaration
    public Looper(IVisualElementScheduler scheduler)
    Parameters
    Type Name Description
    IVisualElementScheduler scheduler

    The Unity UI-Toolkit VisualElement scheduler which will execute the loop.

    Properties

    inLoop

    Check if the Looper is currently active.

    Declaration
    public bool inLoop { get; }
    Property Value
    Type Description
    bool

    queue

    The looper's message queue.

    Declaration
    public ConcurrentQueue<Message> queue { get; }
    Property Value
    Type Description
    ConcurrentQueue<Message>

    Methods

    Loop()

    Start the loop execution.

    Declaration
    public void Loop()

    Quit()

    Promptly stop the loop execution and clear the remaining message without handling them. If you want to safely stop the execution of the loop and handle remaining messages in the queue, use SafelyQuit().

    Declaration
    public void Quit()

    SafelyQuit()

    Stop the loop execution but handle all remaining messages in the queue before clearing it.

    Declaration
    public void SafelyQuit()
    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)