In our game we’ve built our level editor so that each level has a corresponding scene, and I’m trying to get scene addressables to work. I’ve managed to add the scenes to the Default Local Group but when I try to load the scene asset, it fails. Here is the code I’ve written to try and load the scene asset:
# sceneAsset is an AssetReference
sceneAsset.LoadAsset<SceneAsset>().Completed += operation => { Debug.Log($"Loaded Scene: {operation.Result} in async operation {operation}"); };
This will log out this text when run:
Loaded Scene: in async operation UnityEngine.ResourceManagement.ChainOperation`2[UnityEditor.SceneAsset,System.Boolean] result = , status = Failed, Valid = True, canRelease = False
Any help in this manner would be greatly appreciated!
@roshaantariq use var op = myPlayer.LoadAsset();op.Completed +=onLoadDone;
And e.g. in a coroutine while the async operation has not completed;
Debug.Log(op.percentComplete);