I have a simple test project
2 scenes, both addressables
the loading scene has a script which does the … scene loading
scene loader
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour
{
[SerializeField] UnityEngine.AddressableAssets.AssetReference sceneToLoad;
public float loadProgress;
// UI hooks button to launch the scene loading
public void OnClickButtonLoad()
{
StartCoroutine(_OnClickButton());
}
IEnumerator _OnClickButton()
{
var loadDependenciesAsync = UnityEngine.AddressableAssets.Addressables.DownloadDependenciesAsync(sceneToLoad);
yield return loadDependenciesAsync;
var loadAsync = sceneToLoad.LoadSceneAsync(LoadSceneMode.Additive);
loadAsync.Completed += LoadComplete;
// update loadProgress for the UI
while (!loadAsync.IsDone)
{
loadProgress = loadAsync.PercentComplete;
yield return null;
}
}
void LoadComplete(AsyncOperationHandle<SceneInstance> _scn)
{
if (_scn.Status == AsyncOperationStatus.Succeeded)
{
Debug.Log("Downloaded " + _scn.Result.Scene.name);
}
else
Debug.Log("Error: " + _scn.OperationException.Message);
}
}
this loads the scene in the editor but it doesn’t load the scene in the build
the tutorial.addressables:scene loading doesn’t show an extra step required (tuto bug)
what’s the extra step?



