SelectionSystem Selection { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Selection property of the EditorTool class provides access to the SelectionSystem associated with the editor tool. This system is responsible for managing the selection of objects within the editor environment.

Usage

Use the Selection property to interact with the selection system of the editor tool. This can be useful for operations that require knowledge of the currently selected objects or for modifying the selection programmatically.

Example

// Example of accessing the Selection property
EditorTool myTool = new EditorTool();
Sandbox.SelectionSystem selectionSystem = myTool.Selection;

// Use the selection system to perform operations
var selectedObjects = selectionSystem.GetSelectedObjects();
foreach (var obj in selectedObjects)
{
    // Perform operations on each selected object
}