Is there a way to download specific Unity Addressables remote group?

153 views Asked by At

I'm using Addressables remote groups in my game. Each group is packed in separate asset bundle. I'd like to download some remote groups, that I specify in my config file on application start. But, as I understand Addressables.DownloadDependenciesAsync(...) works only with certain assets. It determines which bundles should be downloaded to make specified asset is loaded well, and download them.

But could I somehow specify group name or something to download certain asset bundle?

1

There are 1 answers

0
Roger Crawfis On

Not group specific, but we use different catalogs and use LoadContentCatalogAsync like this to load a particular remote catalog:

    private async void Awake()
    {
        AsyncOperationHandle<IResourceLocator> loadContentCatalogAsync = Addressables.LoadContentCatalogAsync(GetCurrentPlatformURL(), true);
        await loadContentCatalogAsync.Task;

        List<Task> loadingTasks = new(_preloadedAssetNames.Count);

        foreach (string assetName in _preloadedAssetNames)
        {
            var downloadTask = Addressables.DownloadDependenciesAsync(assetName, true);
            loadingTasks.Add(downloadTask.Task);
        }

        await Task.WhenAll(loadingTasks);
        _initialized = true;
    }