Class InteractionTarget
A mesh that handles objects being hovered over it and being dropped onto it.
Inheritance
InteractionTarget
Syntax
public class InteractionTarget : MonoBehaviour
Fields
m_Hovered
Declaration
Field Value
m_Selected
Declaration
protected bool m_Selected
Field Value
m_State
Declaration
protected InteractionTarget.InteractionState m_State
Field Value
Properties
AllTargets
Declaration
public static HashSet<InteractionTarget> AllTargets { get; }
Property Value
AttachTarget
The transform that objects will be attached to when they are dropped on this object's mesh
Declaration
public Transform AttachTarget { get; set; }
Property Value
| Type |
Description |
| Transform |
|
UseInteractionTarget
Declaration
public bool UseInteractionTarget { get; }
Property Value
Methods
OnEnable()
Declaration
protected virtual void OnEnable()
OnStateChanged()
Declaration
protected virtual void OnStateChanged()
SetHovered(Boolean)
Set the hover state of the interaction target
Declaration
public void SetHovered(bool newHoverState)
Parameters
| Type |
Name |
Description |
| Boolean |
newHoverState |
Whether the target is currently hovered
|
SetSelected(Boolean)
Set the selected state of the interaction target
Declaration
public void SetSelected(bool isSelected)
Parameters
| Type |
Name |
Description |
| Boolean |
isSelected |
Whether the target is currently selected
|
Events
interactionStateChanged
Action that is called when the interaction state of the interaction target has changed
Declaration
public event Action<InteractionTarget.InteractionState> interactionStateChanged
Event Type