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: UnityEngine.Dt.App.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.
Declaration
public void Quit()
SafelyQuit()
Stop the loop execution but handle all remaining messages in the queue before clearing it.
Declaration
public void SafelyQuit()