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 features that require manipulation or inspection of selected objects within the scene.
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);