Class SceneViewInteractionModule
Module that handles mouse hovering and selecting interaction targets. When selected, it shows a button to open the create menu.
Namespace: Unity.MARS
Syntax
public class SceneViewInteractionModule : IModule
Properties
CurrentHoverTarget
The interaction target that is currently hovered
Declaration
public InteractionTarget CurrentHoverTarget { get; }
Property Value
Type | Description |
---|---|
InteractionTarget |
CurrentSelection
All of the interaction targets currently selected
Declaration
public List<InteractionTarget> CurrentSelection { get; }
Property Value
Type | Description |
---|---|
List<InteractionTarget> |
LastSimViewClickPosition
The last place where the user clicked in the scene.
Declaration
public Vector3 LastSimViewClickPosition { get; }
Property Value
Type | Description |
---|---|
Vector3 |
SelectionLimit
The max amount of things that can be selected at once
Declaration
public int SelectionLimit { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
AddToSelection()
Declaration
public void AddToSelection()
ClickHandling()
Declaration
public void ClickHandling()
LoadModule()
Declaration
public void LoadModule()
Implements
RequestInteraction(Object, Boolean)
Add or remove an object that needs scene view interaction. If there is at least one user requesting interaction, it will be enabled.
Declaration
public void RequestInteraction(object user, bool enable)
Parameters
Type | Name | Description |
---|---|---|
Object | user | The object that is using scene view interaction, used to avoid duplicate requests. |
Boolean | enable | Whether the object needs interaction enabled or not. |
SingleSelection()
Declaration
public void SingleSelection()
UnloadModule()
Declaration
public void UnloadModule()
Implements
Events
HoverBegin
Event when a new target starts being hovered
Declaration
public event Action<InteractionTarget> HoverBegin
Event Type
Type | Description |
---|---|
Action<InteractionTarget> |
HoverEnd
Event when a target is no longer being hovered
Declaration
public event Action<InteractionTarget> HoverEnd
Event Type
Type | Description |
---|---|
Action<InteractionTarget> |
HoverUpdate
Event during a hover interaction that includes the raycast hit on the target
Declaration
public event Action<InteractionTarget, RaycastHit> HoverUpdate
Event Type
Type | Description |
---|---|
Action<InteractionTarget, RaycastHit> |
SelectionChanged
Event when the target selection has changed
Declaration
public event Action<List<InteractionTarget>> SelectionChanged
Event Type
Type | Description |
---|---|
Action<List<InteractionTarget>> |