Mark commissioning objects as selectable, hoverable, and panel-aware. The core Interaction type lives in the host OC assembly; this package adds selection, outline, panels, and tooling around it.
Type: OC.Interactions.Interaction
Assembly: OC (not shipped with com.open-commissioning.ui)
The host project must reference the Open Commissioning core package. Without it, OC.UI does not compile.
- Modes — e.g.
InteractionMode.Selectioncontrols whether an object participates in selection. - State — flags such as
Hovered,Selected,Disabled(viaInteractionState). - Renderers — list of renderers used by outline and visual feedback.
- Target — reference to the commissioning component or payload.
Refer to the OC package documentation for full API details.
Runtime/Interactions/Scripts/SelectionManager.cs
- Raycasts from Main Camera using configured layer mask and Input System pointer/click actions.
- Skips input when
SelectionManager.Enableis false or pointer is over UI. - Click: selects hit object; Ctrl cycles among stacked hits.
- Handle hits (tag
Handles) are routed separately from object selection. - Fires Unity pointer events (
pointerEnter,select,deselect, etc.) on targets. - Events:
OnSelectionChanged,OnDestroy(when pooled payloads are destroyed).
Enable selection with the Interaction Tool in the AppUI toolbar.
Runtime/Interactions/Scripts/Outline.cs
- Requires
Interactionon the same GameObject. - Maps Hovered →
Outline_1, Selected →Outline_2rendering layers.
See Outline.
Runtime/Panels/Scripts/PanelManager.cs
- Subscribes to
OnSelectionChanged. - Opens a Panel for the selected object’s component type via registered
PanelHandlerinstances.
See Panel Manager and Modules/Panels.md.
Editor/Scripts/InteractionComponentWatcher.cs
When an Interaction is added in the Editor, Outline is added automatically if missing.
| Component | Script | Role |
|---|---|---|
Outline |
Outline.cs |
URP outline layers for hover/select |
Clickable |
Clickable.cs |
Click handling helpers |
PointerEventHandler |
PointerEventHandler.cs |
Pointer event bridge |
Tooltip / TooltipEntity / TooltipDevice |
Various | Tooltip content for TooltipManager |
RuntimeInspector |
See Runtime Inspector | Transform editing in UI |
ColliderMaterial |
ColliderMaterial.cs |
Collider debug draw (Collider View tool) |
Label |
Label.cs |
World-space TextMeshPro label |
HideGroup |
HideGroup.cs |
Hide or fade groups of renderers |
- Add
Interaction(from OC core) and configure modes, colliders, and renderers. - Add
Outline(or let the Editor watcher add it). - Match collider layer to
SelectionManagermask (default layer 10). - Add a
PanelHandler-compatible OC component if you need a property panel. - Optionally add
RuntimeInspector,Label,HideGroup,ColliderMaterial.