I am trying to download all Addressable dependencies in the beginning of my game, so that during gameplay everything is cached. In order to do that, I need a list of all keys to pass to Addressables.DownloadDependenciesAsync. Currently, I do this:
var resourceLocator = await Addressables.InitializeAsync().Task;
var handle = Addressables.DownloadDependenciesAsync(resourceLocator.Keys, Addressables.MergeMode.Union);
This works, but it seems like I shouldn’t do it that way. I am initializing addressables each time I call this method. Will calling InitializeAsync multiple times do anything, eg will it somehow re-initialize? What if someone called Addressables.InitializeAsync() before? Can I rely on always getting a resourceLocator with all keys, or might this break at some point? Is there less hacky way to get a resourceLocator which contains all keys?
Or is there a better way to do this altogether?