Class Leap::Unity::Interaction::InteractionToggle

class Leap.Unity.Interaction.InteractionToggle : public Leap.Unity.Interaction.InteractionButton

A physics-enabled toggle. Toggling is triggered by physically pushing the toggle to its compressed position.

Public Functions

void Toggle ()

Sets this InteractionToggle to the “toggled” state. Calling this function won’t oscillate the state of the toggle; to ‘untoggle’ the control, call Untoggle().

void Untoggle ()

Sets this InteractionToggle to the “untoggled” state.

Public Members

float toggledRestingHeight = 0.25f

The height that this toggle rests at when it is toggled.

Action OnToggle = () => { }

Called when the toggle is ticked (not when unticked; for that, use OnUntoggle.)

summary> Triggered when this toggle is untoggled.

Action OnUntoggle = () => { }

Called when the toggle is unticked.

Properties

bool isToggled { get; set; }

summary> Triggered when this toggle is toggled.

Vector3 RelaxedToggledLocalPosition { get; set; }

Returns the local position of this toggle when it is able to relax into its untoggled position.

overrideVector3 RelaxedLocalPosition { get; set; }

Returns the local position of this toggle when it is able to relax into its untoggled position.