Hello there,
In our project we have the Scenes marked as addressables, so we are calling the following line of code in order to load a Scene via addressables asynchronously and hold its activation:
AsyncOperationHandle<SceneInstance> _operation = Addressables.LoadSceneAsync(_sceneAddressablePath, UnityEngine.SceneManagement.LoadSceneMode.Single, false);
Later on we call this to activate the loaded Scene:
SceneInstance _scene = (SceneInstance) _operation.Result;
_scene.ActivateAsync();
But our problem occurs when we are unloading the current Scene (before activating the next one) and we call the Addressables.Release method to unload some assets.
Addressables.Release(_someLoadedAssetAsyncHandle);
This seems to instantly activate the next Scene. Is this behaviour expected? Are we missing something to avoid this?
I took the liberty to create a test project and attach it in here if someone wants to replicate the issue. In order to replicate the problem you should:
-
Download and open the project;
-
In the ‘Addressables Groups’ tab go into ‘Build’ → ‘New Build’ → ‘Default Build Script’;
-
Still in the ‘Addressables Groups’ tab, go into ‘Play Mode Script’ → ‘Use Existing Build’;
-
Open FirstScene and Play it on the Editor;
-
Click on the ‘Release Circle Asset’ button to release the asset;
-
Watch the scene automatically change;
We tested this on both 1.7.5 and the latest 1.11.2 versions of the Addressables Package.