docs.unity3d.com
    Show / Hide Table of Contents

    Interface IProvidesSlowTasks

    Defines the API for slow task management

    Inherited Members
    IFunctionalityProvider.LoadProvider()
    IFunctionalityProvider.ConnectSubscriber(Object)
    IFunctionalityProvider.UnloadProvider()
    Namespace: Unity.MARS.MARSUtils
    Syntax
    [MovedFrom("Unity.MARS")]
    public interface IProvidesSlowTasks : IFunctionalityProvider

    Methods

    AddMarsTimeSlowTask(Action, Single, Boolean)

    Registers the given task and starts it running at regular intervals based on MARS time

    Declaration
    bool AddMarsTimeSlowTask(Action task, float sleepTime, bool replace = false)
    Parameters
    Type Name Description
    Action task

    The delegate to execute at each interval

    Single sleepTime

    The amount of time to wait between executions

    Boolean replace

    (Optional) Whether this should replace existing parameters for task if it has already been registered

    Returns
    Type Description
    Boolean

    True if the task has not already been added or if replace is true, false otherwise

    AddSlowTask(Action, Single, Boolean)

    Registers the given task and starts it running at regular intervals based on game time

    Declaration
    bool AddSlowTask(Action task, float sleepTime, bool replace = false)
    Parameters
    Type Name Description
    Action task

    The delegate to execute at each interval

    Single sleepTime

    The amount of time to wait between executions

    Boolean replace

    (Optional) Whether this should replace existing parameters for task if it has already been registered

    Returns
    Type Description
    Boolean

    True if the task has not already been added or if replace is true, false otherwise

    RemoveMarsTimeSlowTask(Action)

    Unregisters the given MARS-time task and stops running it

    Declaration
    bool RemoveMarsTimeSlowTask(Action task)
    Parameters
    Type Name Description
    Action task

    The task to remove

    Returns
    Type Description
    Boolean

    True if the task was successfully found and removed, false otherwise

    RemoveSlowTask(Action)

    Unregisters the given task and stops running it

    Declaration
    bool RemoveSlowTask(Action task)
    Parameters
    Type Name Description
    Action task

    The task to remove

    Returns
    Type Description
    Boolean

    True if the task was successfully found and removed, false otherwise

    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