docs.unity3d.com
    Show / Hide Table of Contents

    Method CleanBundleCache

    CleanBundleCache(IEnumerable<String>)

    Removes any AssetBundles that are no longer referenced in the bundle cache. This can occur when a new, updated catalog excludes entries present in an older catalog.

    Declaration
    public static AsyncOperationHandle<bool> CleanBundleCache(IEnumerable<string> catalogsIds = null)
    Parameters
    Type Name Description
    IEnumerable<String> catalogsIds

    The ids of catalogs whose bundle cache entries we want to preserve. If null, entries for all currently loaded catalogs will be preserved.

    Returns
    Type Description
    AsyncOperationHandle<Boolean>

    The operation handle for the request. Note, that it is user's responsibility to release the returned operation; this can be done before or after the operation completes.

    Remarks

    Note, that only AssetBundles loaded through UnityWebRequest are cached. If you want to purge the entire cache, use Caching.ClearCache instead. In the Editor CleanBundleCache should only be called when using the "Use Existing Build (requires built groups)" playmode script as it loads content from bundles.

    See AssetBundle caching for more details.

    Back to top
    Terms of use
    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