Class DelayedActionManager
This object allows for scheduling the invocation of Actions until a specified time has elapsed. It is used to delay callbacks until the end of the current frame in the case that the callback is assigned when an operation is already complete.
Inheritance
Namespace: UnityEngine.ResourceManagement.Util
Syntax
public class DelayedActionManager : MonoBehaviour
Properties
IsActive
Returns whether the DelayedActionManager is created and has pending actions to run.
Declaration
public static bool IsActive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddAction(Delegate, Single, Object[])
Schedule an action to execute after a time delay. If delay is less than or equal 0, the action will wait until the LateUpdate of this object to be invoked.
Declaration
public static void AddAction(Delegate action, float delay = 0F, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Delegate | action | The delegate to invoke. |
System.Single | delay | Time delay to wait until invocation. If less than or equal to 0, the action will be invoked during the LateUpdate call of the current frame. |
System.Object[] | parameters | The parameters to be passed to the action when invoked. |
Clear()
Destroy the current object
Declaration
public static void Clear()
Wait(Single, Single)
Force the update loop to run until it is not active
Declaration
public static bool Wait(float timeout = 0F, float timeAdvanceAmount = 0F)
Parameters
Type | Name | Description |
---|---|---|
System.Single | timeout | Optional timeout value in seconds. |
System.Single | timeAdvanceAmount |
Returns
Type | Description |
---|---|
System.Boolean | True if the DelayedActionManager is not active, False if the timeout is hit. |