Description
The Scene
property of the HammerSceneEditorSession
class provides access to the Sandbox.Scene
instance associated with the current editor session. This property allows you to interact with the scene being edited, enabling operations such as querying scene objects, modifying components, and managing scene state.
Usage
To use the Scene
property, you must have an instance of the HammerSceneEditorSession
class. Once you have the session instance, you can access the Scene
property to perform various operations on the scene.
Example usage:
var session = Editor.MapEditor.HammerSceneEditorSession.Resolve("path/to/map");
var scene = session.Scene;
// Perform operations on the scene
Example
// Example of accessing the Scene property
var session = Editor.MapEditor.HammerSceneEditorSession.Resolve("path/to/map");
var scene = session.Scene;
// Example operation: Iterate over all GameObjects in the scene
foreach (var gameObject in scene.GameObjects)
{
// Perform operations on each GameObject
gameObject.Transform.Position += new Vector3(0, 0, 1); // Move each object up by 1 unit
}