I have moved all the duplicate assets into a separate addressables group & called it “shared assets”. It contains materials/textures/audio/scripts and most importantly - scriptable objects. Each scene is in it’s own addressable group (bundle) and has “GameManager” that spawns prefabs from scriptable objects (which are in “shared assets” group).
Bootstrap scene downloads shared assets and then downloads the Scene_1, however it lacks all the shared assets when loaded. No sounds, and all materials are pink.
How to load Scene_1 so it would use all the assets that needed from “shared assets” bundle? (especially from scriptable objects)
downloading shared assets:
private AssetLabelReference _defaultAssetsKey;
private void DownloadAssets()
{
//string key = "sharedAssets";
AsyncOperationHandle downloadDependencies = Addressables.DownloadDependenciesAsync(_defaultAssetsKey);
downloadDependencies.Completed += OnAssetsLoaded;
}
scene:
private AsyncOperationHandle<SceneInstance> _loadScenesAsync;
public void LoadScene(int BuildIndex)
{
_loadScenesAsync = Addressables.LoadSceneAsync(_sceneAssetsRefs[BuildIndex].RuntimeKey, LoadSceneMode.Single);
}