Do anyone have an examples of EditorSceneManager.LoadSceneInPlayMode behaviour?
I’m making “AssetBundle Loader Emulator” in Editor, to emulate a scene load from asset bundle, without add scene paths to “Build settings → Scene Paths”.
I’m trying use this :
EditorSceneManager.LoadSceneInPlayMode ("Bundles/Town/Town", new LoadSceneParameters (LoadSceneMode.Single, LocalPhysicsMode.None));
I tried to use many variants of Scene path,
but always Unity load scene “Town” without any objects and camera.
var guid = AssetDatabase.FindAssets($"{sceneName} t:scene")[0];
var path = AssetDatabase.GUIDToAssetPath(guid);
Debug.Log(path); // Assets/FooScene.unity
EditorSceneManager.LoadSceneAsyncInPlayMode(path, new LoadSceneParameters(LoadSceneMode.Single));
Using fumobox’s solution I logged out the path of the scene I was trying to load and found that I had missed the “Assets/” at the beginning of the path I was trying to load.
It seems that LoadSceneAsyncInPlayMode will just create a scene with the name you provide if there is nothing at the path you give it. Neat!