docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class IUsesSlowTasksMethods

    Inheritance
    object
    IUsesSlowTasksMethods
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MARS.MARSUtils
    Assembly: Unity.MARS.Interfaces.dll
    Syntax
    [MovedFrom("Unity.MARS")]
    public static class IUsesSlowTasksMethods

    Methods

    AddMarsTimeSlowTask(IUsesSlowTasks, Action, float, bool)

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

    Declaration
    public static bool AddMarsTimeSlowTask(this IUsesSlowTasks obj, Action task, float sleepTime, bool replace = false)
    Parameters
    Type Name Description
    IUsesSlowTasks obj
    Action task

    The delegate to execute at each interval

    float sleepTime

    The amount of time to wait between executions

    bool replace

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

    Returns
    Type Description
    bool

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

    AddSlowTask(IUsesSlowTasks, Action, float, bool)

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

    Declaration
    public static bool AddSlowTask(this IUsesSlowTasks obj, Action task, float sleepTime, bool replace = false)
    Parameters
    Type Name Description
    IUsesSlowTasks obj
    Action task

    The delegate to execute at each interval

    float sleepTime

    The amount of time to wait between executions

    bool replace

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

    Returns
    Type Description
    bool

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

    RemoveMarsTimeSlowTask(IUsesSlowTasks, Action)

    Unregisters the given MARS-time task and stops running it

    Declaration
    public static bool RemoveMarsTimeSlowTask(this IUsesSlowTasks obj, Action task)
    Parameters
    Type Name Description
    IUsesSlowTasks obj
    Action task

    The task to remove

    Returns
    Type Description
    bool

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

    RemoveSlowTask(IUsesSlowTasks, Action)

    Unregisters the given task and stops running it

    Declaration
    public static bool RemoveSlowTask(this IUsesSlowTasks obj, Action task)
    Parameters
    Type Name Description
    IUsesSlowTasks obj
    Action task

    The task to remove

    Returns
    Type Description
    bool

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

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)