Unloading the scene that is open when going into Play mode

Hi!
I’m not finding any info on this, so it’s likely I’m just missing something very obvious.

I have a scene loader that uses additive Addressables.Load/UnloadAsync that stores the SceneInstance of the loaded scene and unloads it when loading another. Works great. However, when working in the editor and entering play mode, the scene open in the editor is obviously not loaded via my script and is therefore not cached for later unloading. So my question is, how do I unload it when moving into another scene? It remains open because I do additive loading.

Any help appreciated!

I found a solution, and as I expected it was dead simple. I was so focused on using the Addressables.UnloadAsync (which does not accept string key) that I forgot about trusty old SceneManager.

1 Like