docs.unity3d.com
    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.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.Core
    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
    Boolean

    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()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023