Skip to content

Selection

Simon edited this page Sep 9, 2020 · 8 revisions

Namespace: WIDVE.Utilities
Location: Utilities/Selection

Selection

The Selection family of scripts provide ways to target and select various objects in the scene. There is also functionality for highlighting objects that can be selected.

Interfaces

ISelectable

This interface allows components to be selected. Components must implement the Select method, which is triggered when they are selected.

IHighlightable

This interface lets components react to a Selector hovering over them, but not selecting them. The StartHighlight method is called when a Selector begins hovering over an object, and the EndHighlight methos is called when the Selector moves away.

Component

OnSelect

The OnSelect component can be used to trigger a simple UnityEvent in response to a selection. This is the best method to set up a quick selectable object in the Inspector.

Selector

The Selector component is an abstract class that is used for selecting objects in the scene.

Property Description
Layers Objects on these layers will be selected
HighlightLayers Objects on these layers will be highlighted
SeparateHighlightLayers If this is unchecked, HighlightLayers is unused. Instead, the Layers layer mask is used for both selection and highlighting
TriggerButton A ButtonFloat that is used to activate a selection
TriggerThreshold When the TriggerButton exceeds this value, a selection is triggered

Clone this wiki locally