docs.unity.cn
    Show / Hide Table of Contents

    Method WaitForObjectCompletion

    WaitForObjectCompletion(UntypedWeakReferenceId, Int32)

    Blocks on the main thread until the load operation completes. This function can be slow and so should be used carefully to avoid frame rate stuttering.

    Declaration
    [ExcludeFromBurstCompatTesting("References managed engine API and static data")]
    public static bool WaitForObjectCompletion(UntypedWeakReferenceId objectId, int timeoutMs = 0)
    Parameters
    Type Name Description
    UntypedWeakReferenceId objectId

    The id of the object to wait for.

    Int32 timeoutMs

    The maximum time in milliseconds this function will wait before returning. Pass 0 to block indefinitely until completion.

    Returns
    Type Description
    Boolean

    Returns false if the timeout was reached before ContentFile completed loading or if the object is not loading.

    Exceptions
    Type Condition
    Exception

    An exception will be thrown if the internal file data is invalid.

    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