Description
The Scene
property of the SceneEditorSession
class provides access to the Sandbox.Scene
object that is currently being edited within the session. This property allows you to interact with the scene, modify its components, and manage its state during an editing session.
Usage
To access the Scene
property, you need to have an instance of the SceneEditorSession
class. Once you have the instance, you can directly access the Scene
property to perform operations on the scene.
Example
// Assuming you have a SceneEditorSession instance
SceneEditorSession session = new SceneEditorSession();
// Access the Scene property
Sandbox.Scene currentScene = session.Scene;
// Example operation: Add a new GameObject to the scene
GameObject newObject = new GameObject("NewObject");
currentScene.AddGameObject(newObject);