Class FlexalonInteractable
Allows a gameObject to be clicked and dragged.
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
FlexalonInteractable
Syntax
[AddComponentMenu("Flexalon/Flexalon Interactable")]
[HelpURL("https://www.flexalon.com/docs/interactable")]
[DisallowMultipleComponent]
public class FlexalonInteractable : MonoBehaviour
Properties
Bounds
If set, the object cannot be dragged outside of the bounds collider.
Declaration
public Collider Bounds { get; set; }
Property Value
Type |
Description |
UnityEngine.Collider |
|
Clickable
Determines if this object can be clicked and generate click events.
Declaration
public bool Clickable { get; set; }
Property Value
Clicked
Unity Event invoked when the object is pressed and released within MaxClickTime.
Declaration
public FlexalonInteractable.InteractableEvent Clicked { get; }
Property Value
DragEnd
Unity Event invoked when the object stops being dragged.
Declaration
public FlexalonInteractable.InteractableEvent DragEnd { get; }
Property Value
Draggable
Determines if this object can be dragged and generate drag events.
Declaration
public bool Draggable { get; set; }
Property Value
DragStart
Unity Event invoked when the object starts being dragged.
Declaration
public FlexalonInteractable.InteractableEvent DragStart { get; }
Property Value
Handle
GameObject to use to select and drag this object. If not set, uses self.
Declaration
public GameObject Handle { get; set; }
Property Value
Type |
Description |
UnityEngine.GameObject |
|
HideCursor
When checked, Cursor.visible is set to false when the object is dragged.
Declaration
public bool HideCursor { get; set; }
Property Value
HoldOffset
Declaration
public Vector3 HoldOffset { get; set; }
Property Value
Type |
Description |
UnityEngine.Vector3 |
|
HoldRotation
The rotation to apply to the object when it is being dragged.
Declaration
public Quaternion HoldRotation { get; set; }
Property Value
Type |
Description |
UnityEngine.Quaternion |
|
HoveredObject
The first hovered object.
Declaration
public static FlexalonInteractable HoveredObject { get; }
Property Value
HoveredObjects
The currently hovered objects.
Declaration
public static List<FlexalonInteractable> HoveredObjects { get; }
Property Value
HoverEnd
Unity Event invoked when the object stops being hovered.
Declaration
public FlexalonInteractable.InteractableEvent HoverEnd { get; }
Property Value
HoverStart
Unity Event invoked when the object starts being hovered.
Declaration
public FlexalonInteractable.InteractableEvent HoverStart { get; }
Property Value
InsertRadius
How close this object needs to a drag target's bounds to be inserted.
Declaration
public float InsertRadius { get; set; }
Property Value
InterpolationSpeed
How quickly the object moves towards the cursor when dragged.
Declaration
public float InterpolationSpeed { get; set; }
Property Value
LayerMask
When dragged, limits which Flexalon Drag Targets will accept this object
by comparing the Layer Mask to the target GameObject's layer.
Declaration
public LayerMask LayerMask { get; set; }
Property Value
Type |
Description |
UnityEngine.LayerMask |
|
LineDirection
Defines the direction of the line when using a line restriction.
If 'Local Space'is checked, this direction is rotated by the transform
of the layout that the object started in.
Declaration
public Vector3 LineDirection { get; set; }
Property Value
Type |
Description |
UnityEngine.Vector3 |
|
LocalSpaceOffset
When checked, the Hold Offset is applied in local space.
Declaration
public bool LocalSpaceOffset { get; set; }
Property Value
LocalSpaceRestriction
When checked, the Plane Normal and Line Direction are applied in local space.
Declaration
public bool LocalSpaceRestriction { get; set; }
Property Value
LocalSpaceRotation
When checked, the Hold Rotation is applied in local space.
Declaration
public bool LocalSpaceRotation { get; set; }
Property Value
MaxClickTime
With a mouse or touch input, a click is defined as a press and release.
The time between press and release must be less than Max Click Time to
count as a click. A drag interaction cannot start until Max Click Time is exceeded.
Declaration
public float MaxClickTime { get; set; }
Property Value
PlaneNormal
Defines the normal of the plane when using a plane restriction.
If 'Local Space' is checked, this normal is rotated by the transform
of the layout that the object started in.
Declaration
public Vector3 PlaneNormal { get; set; }
Property Value
Type |
Description |
UnityEngine.Vector3 |
|
Restriction
Determines how to restrict the object's drag movement.
Declaration
public FlexalonInteractable.RestrictionType Restriction { get; set; }
Property Value
RotateOnDrag
Declaration
public bool RotateOnDrag { get; set; }
Property Value
SelectedObject
The first selected / dragged object.
Declaration
public static FlexalonInteractable SelectedObject { get; }
Property Value
SelectedObjects
The currently selected / dragged objects.
Declaration
public static List<FlexalonInteractable> SelectedObjects { get; }
Property Value
SelectEnd
Unity Event invoked when the object stops being selected (e.g. release mouse).
Declaration
public FlexalonInteractable.InteractableEvent SelectEnd { get; }
Property Value
SelectStart
Unity Event invoked when the object starts being selected (e.g. press down mouse over object).
Declaration
public FlexalonInteractable.InteractableEvent SelectStart { get; }
Property Value
State
The current state of the interactable.
Declaration
public FlexalonInteractable.InteractableState State { get; }
Property Value