Hey guys,
I’ve got a weird issue. I’ve had a project working for some time now using Unity 2019.2.18 and addressable 1.8.3.
It was going great, bundles were loading and everything was working. We were unfortunately forced to update to 2019.3.13. With that, LoadSceneAsync doesn’t seem to keep references between scenes.
For example, we have 2 scenes in 2 bundles. They share some assets between them and we’ve put them into a 3rd bundle.
We’ll call them Scene A, Scene B.
Here’s a code snippet of how we’re loading a scene:
private IEnumerator LoadRoutine(string _addressableName)
{
IsLoading = true;
//Load the next scene.
var async = Addressables.LoadSceneAsync(_addressableName);
while (async.IsDone == false)
{
yield return null;
}
if (async.Status == AsyncOperationStatus.Failed)
{
throw new System.Exception("Failed to load: " + _addressableName + ", " + async.OperationException);
}
IsLoading = false;
}
That snippet of code works just fine in 2019.2.18.
However, in 2019.3.13, when I start up, I can load into Scene A or Scene B just fine. However when I try to go from Scene A to Scene B. Some of the references drop. For example, I’m losing material references and other objects that are needed. I’ll have invisible meshes and such. I can’t even go Scene B → Scene B without losing references. However, once the references are broken, I can try and reload the scene and it’ll work again. So broken SceneB → SceneB and it’ll work again.
The only way I’ve seemed to get around this, is by loading into an empty scene first, waiting for the load to be completed, then load into the next scene. So:
Scene A → Empty Scene → Scene B
That was a lot to take in probably, but has any one else run into this issue?