Class DelayedActionManager | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    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
    System.Object
    DelayedActionManager
    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.

    In This Article
    • Properties
      • IsActive
    • Methods
      • AddAction(Delegate, Single, Object[])
      • Clear()
      • Wait(Single, Single)
    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