SelectionSystem Selection { get; set; }

robot_2Generated
code_blocksInput

Description

The Selection property of the SceneEditorSession class provides access to the SelectionSystem associated with the current scene editor session. This system manages the selection of objects within the scene, allowing for operations such as selecting, deselecting, and querying selected objects.

Usage

Use the Selection property to interact with the selection system of the current scene editor session. This can be useful for implementing custom selection logic or for querying the current selection state within the editor.

Example

// Accessing the Selection property
var session = Editor.SceneEditorSession.Active;
var selectionSystem = session.Selection;

// Example: Deselect all objects
selectionSystem.DeselectAll();

// Example: Select a specific object
GameObject myObject = ...; // Assume this is a valid GameObject
selectionSystem.Select(myObject);