XYSlider.cs

Implements a 2D slider UI element. Tracks user interactions and translates the slider position into normalized values.

Fields & Properteis

RectTransform handle

The draggable handle of the slider.

RectTransform squareArea

The slider's movement bounds.

Vector2 outputValues

Normalized output values in the range [-1, 1].

bool isHovering

Tracks whether the user is hovering over the slider.

LookingGlass.Demos.XYSpotlight xySpotlight

Reference to the spotlight controller.

Vector2 squareSize

Half the width and height of the slider's bounds.

bool isDragging

Tracks whether the handle is being dragged.

Vector3 originalScale

The initial scale of the slider handle.

float scaleFactor

Factor to scale the handle when it is being dragged.

Last updated

Was this helpful?