docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method Task

    Task(Func<T, bool>, CancellationToken)

    Wait until predicate is met, or until token is called. A null predicate can be passed to have it await any change.

    Declaration
    Task<T> Task(Func<T, bool> awaitPredicate, CancellationToken token = default)
    Parameters
    Type Name Description
    Func<T, bool> awaitPredicate

    Callback to be executed on completion of task.

    CancellationToken token

    Token used to trigger a cancellation of the task.

    Returns
    Type Description
    Task<T>

    Task to schedule.

    Task(T, CancellationToken)

    Wait until BindableVariable is set to awaitState.

    Declaration
    Task<T> Task(T awaitState, CancellationToken token = default)
    Parameters
    Type Name Description
    T awaitState

    Variable state to wait for.

    CancellationToken token

    Token used to trigger a cancellation of the task.

    Returns
    Type Description
    Task<T>

    Task to schedule.

    In This Article
    Back to top
    Copyright © 2024 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)