in unity, does EditorSceneManager.OpenScene with param AdditiveWithoutLoading allow to open scene without showing it to user but at the same time an editor script can access its objects and edit them?
Assistant
Yes, in Unity, using EditorSceneManager.OpenScene with the OpenSceneMode.AdditiveWithoutLoading parameter allows you to open a scene additively without actually loading its contents into the editor hierarchy and without displaying it to the user. This mode opens the scene in the background, letting your editor script access the scene's data without the typical overhead of fully loading and displaying the scene.
What does AdditiveWithoutLoading do?
Does not load scene objects into the editor hierarchy visually.
Scene data is opened in the project’s internal scene cache.
You can still access serialized scene data and perform operations in the editor script.
The scene is essentially "hidden," so it is not visible in the hierarchy window nor active.
Can you access and edit scene objects?
You cannot directly access GameObjects or scene root GameObjects in the traditional way if the scene is not loaded. Since the scene is not loaded, the scene’s GameObjects are not instantiated in memory. Essentially, you have just the scene asset opened but not its contents loaded.
In other words:
If you want to edit scene objects (GameObjects, components, etc.), the scene must be loaded.
AdditiveWithoutLoading lets you open the scene asset and possibly modify scene-level data or metadata without fully deserializing and instantiating GameObjects.
To access and modify GameObjects, you need to load the scene fully, e.g., with OpenSceneMode.Additive (which loads and shows the scene content).
Practical use cases
AdditiveWithoutLoading: Useful for scene-based processing that does not require working with GameObjects directly. For example, analyzing scene asset metadata, scene hierarchy structure, lightmaps, or custom data embedded in the scene file.
Additive: Use when you want to load the scene fully, making its GameObjects accessible in the editor and allowing editing.
Summary
Mode
Scene Loaded
GameObjects Accessible
Scene Visible in Hierarchy
Use case
Additive
Yes
Yes
Yes
Full editing
AdditiveWithoutLoading
No
No
No
Metadata or scene asset-level ops
Example
csharp
using UnityEditor.SceneManagement;
using UnityEngine.SceneManagement;
var scene = EditorSceneManager.OpenScene("Assets/Scenes/ExampleScene.unity", OpenSceneMode.AdditiveWithoutLoading);
// `scene.isLoaded` will be false here, no GameObjects accessible.
if(!scene.isLoaded)
{
Debug.Log("Scene is opened but not loaded, can't access GameObjects.");
}
If you want to access and edit scene objects:
csharp
var scene = EditorSceneManager.OpenScene("Assets/Scenes/ExampleScene.unity", OpenSceneMode.Additive);
// scene.isLoaded == true, GameObjects accessible.
Conclusion
No, AdditiveWithoutLoading does not allow editing or accessing GameObjects because the scene contents are not loaded.
Use Additive mode to get access to GameObjects and edit the scene objects in Editor scripts.
Let me know if you want help on manipulating scene content programmatically or about advanced scene loading/editing workflows!