Language
Edit

Slider Class

Definition

A slider that can be moved by grabbing / pinching a slider thumb

[UnityEngine.AddComponentMenu("MRTK/UX/Slider")]
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/sliders")]
public class Slider : MixedReality.Toolkit.StatefulInteractable, MixedReality.Toolkit.ISnapInteractable
[<UnityEngine.AddComponentMenu("MRTK/UX/Slider")>]
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/sliders")>]
type Slider = class
    inherit StatefulInteractable
    interface ISnapInteractable
Public Class Slider
Inherits StatefulInteractable
Implements ISnapInteractable
Inheritance
UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable
Slider
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.HelpURLAttribute
Implements

Constructors

Name Description
Slider()

Properties

Name Description
HandleTransform

Called by interactors to query which exact transform on an interactable should be considered the snappable affordance.

IsTouchable

Whether or not this slider is manipulatable by IPokeInteractors. If true, IGrabInteractors will have no effect.

MaxValue

The maximum value that the slider can take on

MinValue

The minimum value that the slider can take on

NormalizedValue

The slider's normalized value calculated using the MinValue and MaxValue properties.

OnValueUpdated

A Unity event that is invoked when Value changes.

SliderEnd

A transform marking the end point of the slider track.

SliderStart

A transform marking the starting point of the slider track.

SliderStepDivisions

Property accessor of sliderStepDivisions, it holds the number of subdivisions the slider is split into.

SliderTrackDirection

Returns the vector from the slider start to end positions

SliderValue
Obsolete.

The current value of the slider.

SnapToPosition

Determines whether or not this slider snaps to the designated position on the slider. Grab interactions will not snap, regardless of the value of this property.

StartInteractionPoint

The interaction point at the beginning of an interaction.

StartSliderValue

Float value that holds the starting value of the slider.

TrackCollider

Collider that covers the entire slider track area.

UseSliderStepDivisions

Property accessor of useSliderStepDivisions, it determines whether the slider steps according to subdivisions or continuously.

Value

The current value of the slider

Methods

Name Description
ApplyRequiredSettings()

Invoked on Start(), Awake(), and Reset() to apply required settings to this Slider instance.

Awake()

A Unity event function that is called when an enabled script instance is being loaded.

IsSelectableBy(IXRSelectInteractor) UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable.IsSelectableBy(UnityEngine.XR.Interaction.Toolkit.IXRSelectInteractor)
OnSelectEntered(SelectEnterEventArgs) UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable.OnSelectEntered(UnityEngine.XR.Interaction.Toolkit.SelectEnterEventArgs)
ProcessInteractable(XRInteractionUpdateOrder+UpdatePhase) UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable.ProcessInteractable(UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder.UpdatePhase)
Reset()

A Unity event function that is called when the script should reset it's default values

Start()

A Unity event function that is called on the frame when a script is enabled just before any of the update methods are called the first time.

Applies to