Class Looper
An object that contains its own message queue and its own running loop for dequeuing messages to pass them to Handler targets.
Inherited Members
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.
Declaration
public void Quit()
Remarks
If you want to safely stop the execution of the loop and handle remaining messages in the queue, use SafelyQuit().
SafelyQuit()
Stop the loop execution but handle all remaining messages in the queue before clearing it.
Declaration
public void SafelyQuit()