Class AsyncOperationCache | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class AsyncOperationCache

    This class allows for recycling IAsyncOperation object in order to reduce GC load.

    Inheritance
    System.Object
    AsyncOperationCache
    Namespace: UnityEngine.ResourceManagement.AsyncOperations
    Syntax
    public class AsyncOperationCache

    Fields

    Instance

    The singleton AsyncOperationCache instance.

    Declaration
    public static readonly AsyncOperationCache Instance
    Field Value
    Type Description
    AsyncOperationCache

    Methods

    Acquire<TAsyncOperation>()

    Acquire an IAsyncOperation.

    Declaration
    public TAsyncOperation Acquire<TAsyncOperation>()
        where TAsyncOperation : IAsyncOperation, new()
    Returns
    Type Description
    TAsyncOperation

    An IAsyncOperation of type TAsyncOperation.

    Type Parameters
    Name Description
    TAsyncOperation

    The type of IAsyncOperation to be returned.

    Clear()

    Clear all cached IAsyncOperation object.

    Declaration
    public void Clear()

    Release(IAsyncOperation)

    Release a completed IAsyncOperation back into the cache. ResetStatus will be called on the operation before it is used again.

    Declaration
    public void Release(IAsyncOperation operation)
    Parameters
    Type Name Description
    IAsyncOperation operation

    The operation to release.

    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