public sealed class Selection<T> where T : notnullWhat is selected, in order, as something a view can bind to.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Backed by a CollectionSignal`1 rather than a plain list, so a selection list in the UI reconciles the items that changed instead of rebuilding — which matters because box-selecting across a hierarchy changes the selection on every mouse-move.
Ordered, and the last one added is Primary. Multi-object editing needs a reference object to show values from and to apply-to-all against, and "the one you clicked last" is what every editor means by it.
Deliberately not undoable. Selection is where you are looking, not what you have changed, and an undo stack that rewinds the camera and the selection is one that never gets back to the edit you wanted to take back. Commands that need it read Selection at execution time.
Fields and properties (5)
public int CountHow many things are selected.
public bool IsEmptyWhether nothing is selected.
public T? PrimaryThe one an inspector shows when several are selected: the most recently added.
public IReadOnlyList<T> ItemsThe selection as a list a view can reconcile against.
public T this[int index]The item at .
Methods (9)
public Selection(IEqualityComparer<T>? comparer = null)Creates an empty selection.
public bool Contains(T item)Whether something is selected.
public void Set(T item)Replaces the selection with one thing.
public void Set(IEnumerable<T> selection)Replaces the selection.
public bool Add(T item)Adds something, if it is not already selected.
public bool Remove(T item)Removes something.
public bool Toggle(T item)Selects something if it is not selected, deselects it if it is.
public void Clear()Deselects everything.
public IEnumerator<T> GetEnumerator()The selected things, in order.
Used by (47, showing 40)
- AddComponentMenuTestsVixen.Editor.App.Tests
- BlockoutBooleanVixen.Editor.Blockout
- BlockoutBooleanTestsVixen.Editor.Blockout.Tests
- BlockoutCreateVixen.Editor.Blockout
- BlockoutCreateTestsVixen.Editor.Blockout.Tests
- BlockoutGeometryTestsVixen.Editor.Blockout.Tests
- BlockoutHandoffVixen.Editor.Blockout
- BlockoutHistoryTestsVixen.Editor.Blockout.Tests
- BlockoutModeVixen.Editor.Blockout
- BlockoutSelectionTestsVixen.Editor.Blockout.Tests
- BlockoutSurfaceTestsVixen.Editor.Blockout.Tests
- ComponentGizmoTestsVixen.Editor.SceneView.Tests
- ComponentGizmosVixen.Editor.SceneView
- DropIntoFieldTestsVixen.Editor.App.Tests
- DropIntoSceneTestsVixen.Editor.App.Tests
- EditorApplicationVixen.Editor.App
- EditorContextVixen.Editor.Core
- EditorProjectVixen.Editor.Core
- GridViewTestsVixen.Editor.App.Tests
- IconContributionTestsVixen.Editor.App.Tests
- MarqueeTestsVixen.Editor.SceneView.Tests
- MeshEditVixen.Editor.SceneView
- MeshEditTestsVixen.Editor.SceneView.Tests
- MilestoneE3TestsVixen.Editor.App.Tests
- MilestoneE5TestsVixen.Editor.App.Tests
- OutlinerColumnTestsVixen.Editor.App.Tests
- OutlinerTestsVixen.Editor.App.Tests
- PaneVixen.Editor.SceneView.Tests
- PanelBehaviourTestsVixen.Editor.App.Tests
- PrimitiveShapeTestsVixen.Editor.SceneView.Tests
- ProjectBrowserVixen.Editor.App
- ProxyShapeViewVixen.Editor.AssetEditors
- SceneDocumentVixen.Editor.SceneView
- SceneHierarchyViewVixen.Editor.AssetEditors
- SceneLinesVixen.Editor.SceneView
- SceneMaterialTestsVixen.Editor.SceneView.Tests
- SceneMeshesVixen.Editor.SceneView
- SceneViewportVixen.Editor.SceneView
- SelectionTestsVixen.Editor.Core.Tests
- SequenceViewVixen.Editor.AssetEditors