Interface IVisualElementScheduledItem
Represents a scheduled task created with a VisualElement's schedule interface.
Namespace: UnityEngine.UIElements
Syntax
public interface IVisualElementScheduledItem
Properties
element
Returns the VisualElement this object is associated with.
Declaration
VisualElement element { get; }
Property Value
Type | Description |
---|---|
VisualElement |
isActive
Will be true when this item is scheduled. Note that an item's callback will only be executed when it's VisualElement is attached to a panel.
Declaration
bool isActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Every(Int64)
Repeats this action after a specified time.
Declaration
IVisualElementScheduledItem Every(long intervalMs)
Parameters
Type | Name | Description |
---|---|---|
Int64 | intervalMs | Minimum amount of time in milliseconds between each action execution. |
Returns
Type | Description |
---|---|
IVisualElementScheduledItem | This ScheduledItem. |
ExecuteLater(Int64)
Cancels any previously scheduled execution of this item and re-schedules the item.
Declaration
void ExecuteLater(long delayMs)
Parameters
Type | Name | Description |
---|---|---|
Int64 | delayMs | Minimum time in milliseconds before this item will be executed. |
ForDuration(Int64)
After specified duration, the item will be automatically unscheduled.
Declaration
IVisualElementScheduledItem ForDuration(long durationMs)
Parameters
Type | Name | Description |
---|---|---|
Int64 | durationMs | The total duration in milliseconds where this item will be active. |
Returns
Type | Description |
---|---|
IVisualElementScheduledItem | This ScheduledItem. |
Pause()
Removes this item from its VisualElement's scheduler.
Declaration
void Pause()
Resume()
If not already active, will schedule this item on its VisualElement's scheduler.
Declaration
void Resume()
StartingIn(Int64)
Adds a delay to the first invokation.
Declaration
IVisualElementScheduledItem StartingIn(long delayMs)
Parameters
Type | Name | Description |
---|---|---|
Int64 | delayMs | The minimum number of milliseconds after activation where this item's action will be executed. |
Returns
Type | Description |
---|---|
IVisualElementScheduledItem | This ScheduledItem. |
Until(Func<Boolean>)
Item will be unscheduled automatically when specified condition is met.
Declaration
IVisualElementScheduledItem Until(Func<bool> stopCondition)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | stopCondition | When condition returns true, the item will be unscheduled. |
Returns
Type | Description |
---|---|
IVisualElementScheduledItem | This ScheduledItem. |