Addressables.LoadAssetsAsync loads every file twice

So, I don’t know what happened, but it just happened. Addressables.LoadAssetsAsync now loads every file twice. I have 33 files but I get twice as much - 66.

Here’s code, asset group settings and its contents.
What’s wrong? Why did it suddenly stopped working correctly?

private void Awake()
        {
            Addressables.LoadResourceLocationsAsync("LevelsData").Completed += OnResourceLocationsLoaded;
        }

        private void OnResourceLocationsLoaded(AsyncOperationHandle<IList<IResourceLocation>> handle)
        {
            resourceLocationsHandle = handle;

            Addressables.LoadAssetsAsync(handle.Result, (LevelGameScene levelGameScene) =>
            {
                levelScenes.Add(levelGameScene);
            }).Completed += OnLevelGameScenesLoaded;
        }

        private void OnLevelGameScenesLoaded(AsyncOperationHandle<IList<LevelGameScene>> handle)
        {
            levelScenesHandle = handle;
            Addressables.Release(resourceLocationsHandle);
        }


Bump

You are getting the locations, and it will return a location per type, Object and LevelData (assuming LevelData is the type of the Asset)

You can probably load the assets using the label directly.

Addressables.LoadAssetsAsync<LevelData>(“LevelData“, null, Union, false)

or

Addressables.LoadAssetsAsync<LevelData>(new List<string>(){“LevelData“}, null, Union, false )

Ok, this helped me

1 Like