docs.unity3d.com
    显示 / 隐藏目录

    Class IUsesSlowTasksMethods

    Inheritance
    Object
    IUsesSlowTasksMethods
    Namespace: Unity.MARS
    Syntax
    public static class IUsesSlowTasksMethods

    Methods

    AddMarsTimeSlowTask(IUsesSlowTasks, Action, Single, Boolean)

    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

    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(IUsesSlowTasks, Action, Single, Boolean)

    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

    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(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
    Boolean

    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
    Boolean

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

    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)