# 3. LoadContentCatalogAsync Part of [[Modding with Addressables]]. Prev: [[2. Authoring a Content Pack]]. Next: [[4. Discovery Trust and Updates]]. Official 2.9.1: [Manage content catalogs](https://docs.unity3d.com/Packages/[email protected]/manual/LoadContentCatalogAsync.html) and the [`LoadContentCatalogAsync` API](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.AddressableAssets.Addressables.LoadContentCatalogAsync.html). The default catalog may already load at initialization ([[5. Scenes Catalogs and Remote Content]]). This part is **additional** catalogs. ## 3.1 Official signatures (2.9.1) ```csharp Addressables.LoadContentCatalogAsync(string catalogPath, string providerSuffix = null); Addressables.LoadContentCatalogAsync(string catalogPath, bool autoReleaseHandle, string providerSuffix = null); ``` Both return `AsyncOperationHandle<IResourceLocator>`. `catalogPath` is the location of the runtime catalog (a URL or a local path). `providerSuffix`, if not null or empty, is appended to provider ids loaded from that data (official; use it only if you have a collision reason — do not invent a suffix scheme "for safety"). ## 3.2 Hash files and cache Official remarks: you can cache a catalog by providing the **hash file** the content build created, at the **same URL** as the catalog JSON, **same name**, different extension. If the hash is unchanged, Addressables loads the **cached** catalog; if the hash changed or no hash file is present, it downloads the catalog first. ## 3.3 autoReleaseHandle (you usually want true) Official: to download a **new** remote catalog later, prior `LoadContentCatalogAsync` operations that point at that catalog must have been **released**. Otherwise the system can reuse the **operation cache** and skip the download. Official typical path: `autoReleaseHandle: true`, because there is generally no reason to hold the handle after the catalog is in. Official: once a catalog is loaded, you **cannot unload** it. You can **update** it; you must have released the load handle first. See part 4. ```csharp using System.Collections; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceLocations; /// <summary> /// Official additional-catalog load (2.9.1 manual). NOT compiled in Unity. /// </summary> public sealed class ModCatalogLoader : MonoBehaviour { [SerializeField] string catalogPath; public IEnumerator LoadCatalog() { AsyncOperationHandle<IResourceLocator> handle = Addressables.LoadContentCatalogAsync(catalogPath, true); yield return handle; if (handle.Status != AsyncOperationStatus.Succeeded) { Debug.LogError(quot;Catalog failed: {catalogPath} {handle.Status}"); yield break; } // Keys in the new catalog are now valid for LoadAssetAsync / InstantiateAsync. } } ``` After a successful load, use the same load/release patterns as [[3. Loading Instantiating and Releasing]]. A failed catalog must not deadlock boot — official Addressables guidance in the existing series still applies. Official tip: **Catalog Download Timeout** in Addressables settings sets a timeout for catalog downloads. Confirm the property in the 2.9.1 Groups / settings Inspector. ## 3.4 Exercise Point `catalogPath` at the catalog from part 2 (even a `file://` or a streaming-assets-relative path you actually produced). Log success or failure. Then `InstantiateAsync` one labeled prefab from that catalog. Release the instance correctly. ## Sources - https://docs.unity3d.com/Packages/[email protected]/manual/LoadContentCatalogAsync.html - https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.AddressableAssets.Addressables.LoadContentCatalogAsync.html