docs.unity3d.com
    Show / Hide Table of Contents

    Class BaseSlider<TValueType, THandleValueType>

    Base class for any Slider (TouchSliderFloat, TouchSliderInt, SliderFloat, SliderInt).

    Inheritance
    Object
    CallbackEventHandler
    Focusable
    VisualElement
    ExVisualElement
    BaseSlider<TValueType, THandleValueType>
    ColorSlider
    RangeSliderBase<TRangeType, TValueType>
    SliderBase<TValueType>
    TouchSlider<TValueType>
    Inherited Members
    ExVisualElement.contentContainer
    ExVisualElement.outlineColor
    ExVisualElement.backgroundColor
    ExVisualElement.passMask
    VisualElement.disabledUssClassName
    UnityEngine.UIElements.VisualElement.ExecuteDefaultAction(UnityEngine.UIElements.EventBase)
    UnityEngine.UIElements.VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    UnityEngine.UIElements.VisualElement.SetEnabledFromHierarchy(System.Boolean)
    VisualElement.SetEnabled(Boolean)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    UnityEngine.UIElements.VisualElement.Overlaps(UnityEngine.Rect)
    UnityEngine.UIElements.VisualElement.DoMeasure(System.Single, UnityEngine.UIElements.VisualElement.MeasureMode, System.Single, UnityEngine.UIElements.VisualElement.MeasureMode)
    UnityEngine.UIElements.VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(String)
    VisualElement.RemoveFromClassList(String)
    VisualElement.ToggleInClassList(String)
    VisualElement.EnableInClassList(String, Boolean)
    VisualElement.ClassListContains(String)
    VisualElement.FindAncestorUserData()
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Single, System.Single, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, System.Single>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Rect, UnityEngine.Rect, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Rect>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Color, UnityEngine.Color, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Color>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Vector3, UnityEngine.Vector3, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector3>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Vector2, UnityEngine.Vector2, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector2>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Quaternion, UnityEngine.Quaternion, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Quaternion>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.UIElements.Experimental.StyleValues, UnityEngine.UIElements.Experimental.StyleValues, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, System.Single>, System.Single, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, System.Single>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Rect>, UnityEngine.Rect, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Rect>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Color>, UnityEngine.Color, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Color>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Vector3>, UnityEngine.Vector3, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector3>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Vector2>, UnityEngine.Vector2, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector2>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Quaternion>, UnityEngine.Quaternion, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Quaternion>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.UIElements.Experimental.StyleValues, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Layout(UnityEngine.Rect, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.TopLeft(UnityEngine.Vector2, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Size(UnityEngine.Vector2, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Scale(System.Single, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Position(UnityEngine.Vector3, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Rotation(UnityEngine.Quaternion, System.Int32)
    VisualElement.Add(VisualElement)
    VisualElement.Insert(Int32, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(Int32)
    VisualElement.Clear()
    VisualElement.ElementAt(Int32)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    UnityEngine.UIElements.VisualElement.Sort(System.Comparison<UnityEngine.UIElements.VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    UnityEngine.UIElements.VisualElement.GetFirstOfType<T>()
    UnityEngine.UIElements.VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IVisualElementScheduler.Execute(System.Action<UnityEngine.UIElements.TimerState>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IVisualElementScheduler.Execute(System.Action)
    VisualElement.viewDataKey
    VisualElement.userData
    UnityEngine.UIElements.VisualElement.canGrabFocus
    UnityEngine.UIElements.VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.position
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.rotation
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.scale
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.matrix
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IExperimentalFeatures.animation
    VisualElement.hierarchy
    UnityEngine.UIElements.VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    UnityEngine.UIElements.VisualElement.Item[System.Int32]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.alignContent
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.alignItems
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.alignSelf
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.backgroundColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.backgroundImage
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomLeftRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomRightRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderLeftColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderLeftWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderRightColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderRightWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopLeftRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopRightRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.bottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.color
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.display
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexBasis
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexDirection
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexGrow
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexShrink
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexWrap
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.fontSize
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.height
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.justifyContent
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.left
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.letterSpacing
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginBottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginLeft
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginRight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginTop
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.maxHeight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.maxWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.minHeight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.minWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.opacity
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingBottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingLeft
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingRight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingTop
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.position
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.right
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.rotate
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.scale
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.textOverflow
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.top
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.transformOrigin
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.transitionDelay
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.transitionDuration
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.transitionProperty
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.transitionTimingFunction
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.translate
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityBackgroundImageTintColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityBackgroundScaleMode
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityFont
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityFontDefinition
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityFontStyleAndWeight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityParagraphSpacing
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceBottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceLeft
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceRight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceTop
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityTextAlign
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityTextOutlineColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityTextOutlineWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityTextOverflowPosition
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.visibility
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.whiteSpace
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.width
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.wordSpacing
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    UnityEngine.UIElements.CallbackEventHandler.RegisterCallback<TEventType>(UnityEngine.UIElements.EventCallback<TEventType>, UnityEngine.UIElements.TrickleDown)
    UnityEngine.UIElements.CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(UnityEngine.UIElements.EventCallback<TEventType, TUserArgsType>, TUserArgsType, UnityEngine.UIElements.TrickleDown)
    UnityEngine.UIElements.CallbackEventHandler.UnregisterCallback<TEventType>(UnityEngine.UIElements.EventCallback<TEventType>, UnityEngine.UIElements.TrickleDown)
    UnityEngine.UIElements.CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(UnityEngine.UIElements.EventCallback<TEventType, TUserArgsType>, UnityEngine.UIElements.TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Syntax
    public abstract class BaseSlider<TValueType, THandleValueType> : ExVisualElement, IEventHandler, IStylePropertyAnimations, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IValidatableElement<TValueType>, INotifyValueChanging<TValueType>, INotifyValueChanged<TValueType> where TValueType : IEquatable<TValueType> where THandleValueType : struct, IComparable, IEquatable<THandleValueType>
    Type Parameters
    Name Description
    TValueType

    A comparable value type.

    THandleValueType

    A value type for a single handle of the slider. This can be the same as TValueType.

    Constructors

    BaseSlider()

    Default constructor.

    Declaration
    protected BaseSlider()

    Fields

    m_DraggerManipulator

    The dragger manipulator used to move the slider.

    Declaration
    protected Draggable m_DraggerManipulator
    Field Value
    Type Description
    Draggable

    m_HighValue

    Slider max value.

    Declaration
    protected THandleValueType m_HighValue
    Field Value
    Type Description
    THandleValueType

    m_LowValue

    Slider min value.

    Declaration
    protected THandleValueType m_LowValue
    Field Value
    Type Description
    THandleValueType

    m_PreviousValue

    The previous value of the slider before the user started interacting with it.

    Declaration
    protected TValueType m_PreviousValue
    Field Value
    Type Description
    TValueType

    m_Value

    The current value of the slider.

    Declaration
    protected TValueType m_Value
    Field Value
    Type Description
    TValueType

    Properties

    formatString

    The format string used to display the value of the slider.

    Declaration
    public string formatString { get; set; }
    Property Value
    Type Description
    String

    highValue

    Specify the maximum value in the range of this slider.

    Declaration
    public THandleValueType highValue { get; set; }
    Property Value
    Type Description
    THandleValueType

    invalid

    The invalid state of the slider.

    Declaration
    public bool invalid { get; set; }
    Property Value
    Type Description
    Boolean
    Implements
    IValidatableElement<TValueType>.invalid

    lowValue

    Specify the minimum value in the range of this slider.

    Declaration
    public THandleValueType lowValue { get; set; }
    Property Value
    Type Description
    THandleValueType

    validateValue

    The validation function used to validate the value of the slider.

    Declaration
    public Func<TValueType, bool> validateValue { get; set; }
    Property Value
    Type Description
    Func<TValueType, Boolean>
    Implements
    IValidatableElement<TValueType>.validateValue

    value

    The current value of the slider.

    Declaration
    public TValueType value { get; set; }
    Property Value
    Type Description
    TValueType
    Implements
    UnityEngine.UIElements.INotifyValueChanged<T>.value

    Methods

    Clamp(TValueType, THandleValueType, THandleValueType)

    Utility method to clamp a TValueType value between specified bounds.

    Declaration
    protected abstract TValueType Clamp(TValueType v, THandleValueType lowBound, THandleValueType highBound)
    Parameters
    Type Name Description
    TValueType v

    The value to clamp.

    THandleValueType lowBound

    Minimum

    THandleValueType highBound

    Maximum

    Returns
    Type Description
    TValueType

    The clamped value.

    ClampValue()

    Called when the low or high value has changed and needs to check if the current value fits in this new range.

    Declaration
    protected virtual void ClampValue()

    ComputeValueFromHandlePosition(Single, Single)

    Returns the value to set as slider value based on a given dragger position.

    Declaration
    protected virtual TValueType ComputeValueFromHandlePosition(float sliderLength, float dragElementPos)
    Parameters
    Type Name Description
    Single sliderLength

    The length of the slider.

    Single dragElementPos

    The position of the dragger.

    Returns
    Type Description
    TValueType

    The value to set as slider value based on a given dragger position.

    Decrement(THandleValueType)

    Method to implement which returns the decrement of a given value.

    Declaration
    protected abstract THandleValueType Decrement(THandleValueType val)
    Parameters
    Type Name Description
    THandleValueType val

    The value to decrement.

    Returns
    Type Description
    THandleValueType

    The decremented value.

    GetClampedValue(TValueType)

    Return the clamped value using current lowValue and highValue values. The method also checks if low and high values are inverted.

    Declaration
    protected virtual TValueType GetClampedValue(TValueType newValue)
    Parameters
    Type Name Description
    TValueType newValue

    The value to clamp.

    Returns
    Type Description
    TValueType

    GetSliderRect()

    Returns the rect of the interactive part of the slider.

    Declaration
    protected virtual Rect GetSliderRect()
    Returns
    Type Description
    Rect

    The rect of the interactive part of the slider.

    Increment(THandleValueType)

    Method to implement which returns the increment of a given value.

    Declaration
    protected abstract THandleValueType Increment(THandleValueType val)
    Parameters
    Type Name Description
    THandleValueType val

    The value to increment.

    Returns
    Type Description
    THandleValueType

    The incremented value.

    OnGeometryChanged(GeometryChangedEvent)

    Event callback called when the geometry of the slider has changed in the layout.

    Declaration
    protected virtual void OnGeometryChanged(GeometryChangedEvent evt)
    Parameters
    Type Name Description
    GeometryChangedEvent evt

    The geometry changed event.

    OnSliderRangeChanged()

    Called when the low or high value of Slider has changed.

    Declaration
    protected virtual void OnSliderRangeChanged()

    OnTrackClicked()

    Called when the track has received a click event. Always check if the mouse has moved using hasMoved.

    Declaration
    protected virtual void OnTrackClicked()

    OnTrackDown(Draggable)

    Event callback called when a pointer down event is received.

    Declaration
    protected virtual void OnTrackDown(Draggable dragger)
    Parameters
    Type Name Description
    Draggable dragger

    The dragger manipulator.

    OnTrackDragged(Draggable)

    Event callback called when the dragger is dragged.

    Declaration
    protected virtual void OnTrackDragged(Draggable dragger)
    Parameters
    Type Name Description
    Draggable dragger

    The dragger manipulator.

    OnTrackUp(Draggable)

    Event callback called when a pointer up event is received.

    Declaration
    protected virtual void OnTrackUp(Draggable dragger)
    Parameters
    Type Name Description
    Draggable dragger

    The dragger manipulator.

    ParseHandleValueToString(THandleValueType)

    Method to implement to resolve a TValueType value into a String value.

    You can use ToString() for floating point value types for example.

    You can also round the value if you want a specific number of decimals.

    Declaration
    protected virtual string ParseHandleValueToString(THandleValueType val)
    Parameters
    Type Name Description
    THandleValueType val

    The TValueType value to convert.

    Returns
    Type Description
    String

    ParseStringToValue(String, out TValueType)

    Method to implement to resolve a String value into a TValueType value.

    You can use TryParse(String, Single) for floating point value types for example.

    Declaration
    protected abstract bool ParseStringToValue(string strValue, out TValueType value)
    Parameters
    Type Name Description
    String strValue

    The String value to convert.

    TValueType value

    The StringThe converted value.

    Returns
    Type Description
    Boolean

    True if can be parsed, False otherwise.

    ParseValueToString(TValueType)

    Method to implement to resolve a TValueType value into a String value.

    You can use ToString() for floating point value types for example.

    You can also round the value if you want a specific number of decimals.

    Declaration
    protected virtual string ParseValueToString(TValueType val)
    Parameters
    Type Name Description
    TValueType val

    The TValueType value to convert.

    Returns
    Type Description
    String

    SetValueFromDrag(Single)

    Custom implementation of the slider value from the drag position.

    Declaration
    protected virtual void SetValueFromDrag(float newPos)
    Parameters
    Type Name Description
    Single newPos

    The new position of the dragger.

    SetValueWithoutNotify(TValueType)

    Set the value of the slider without sending any event.

    Declaration
    public abstract void SetValueWithoutNotify(TValueType newValue)
    Parameters
    Type Name Description
    TValueType newValue

    The new value of the slider.

    Implements
    UnityEngine.UIElements.INotifyValueChanged<T>.SetValueWithoutNotify(T)

    SliderLerpUnclamped(THandleValueType, THandleValueType, Single)

    Method to implement which returns a value based on the linear interpolation of a given interpolant between a specific range.

    Usually you can use directly LerpUnclamped for floating point value types.

    Declaration
    protected abstract TValueType SliderLerpUnclamped(THandleValueType a, THandleValueType b, float interpolant)
    Parameters
    Type Name Description
    THandleValueType a

    The lowest value in the range.

    THandleValueType b

    The highest value in the range.

    Single interpolant

    The normalized value to process.

    Returns
    Type Description
    TValueType

    SliderNormalizeValue(THandleValueType, THandleValueType, THandleValueType)

    Method to implement which returns the normalized value of a given value in a specific range.

    Usually you can use directly an InverseLerp for floating point value types.

    Declaration
    protected abstract float SliderNormalizeValue(THandleValueType currentValue, THandleValueType lowerValue, THandleValueType higherValue)
    Parameters
    Type Name Description
    THandleValueType currentValue

    The value to normalize.

    THandleValueType lowerValue

    The lowest value in the range.

    THandleValueType higherValue

    The highest value in the range.

    Returns
    Type Description
    Single

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    NotifyValueChangingExtensions.RegisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    NotifyValueChangingExtensions.UnregisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    VisualElementExtensions.GetContext(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, Boolean)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, PopoverPlacement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.GetWorldBoundingBox(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023