Is there any way for me to create a list of SceneAssets that is the same as the scenes included in
EditorBuildSettings.scenes? I know that this article tells you how to do it the other way around, but I can’t find a way to convert an EditorBuildSettingsScene to a SceneAsset. I can get the scene path from the EditorBuildSettingsScene, but for some reason, SceneAssets don’t have a constructor that can take a scene path and create the SceneAsset.
Doing a bit of a search I can’t see that you can create scene asset’s easily via code.
Most of seen is a combination of EditorSceneManager.NewScene
+ EditorSceneManager.SaveScene
.
I’m not talking about the actual scene in the project, but rather the “SceneAsset” class in Unity, which is used to reference scenes in the inspector. It doesn’t have a constructor, so I don’t know how to automatically assign a value to it.
I mean it has a path to the asset. So just AssetDataBase.LoadAssetAtPath
?
1 Like
Oh yeah, that seems to work. Thanks for the help!