logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityUiSliderComponent

    Unity UI slider component that provides range-based value selection with configurable bounds and precision.
    Supports both integer and float value types with automatic rounding and validation for numeric input within defined ranges.
    Implements IUiSlideable interface for comprehensive range control functionality within the Unity UI system.

    Inheritance
    object
    UnityUiComponent
    UnityUiInteractableComponent
    UnityUiSliderComponent
    Implements
    IUiInteractable
    IUiComponent
    IUiSlideable
    IComponent
    IFoundationSettings
    Inherited Members
    UnityUiInteractableComponent._contentWrapperGameObject
    UnityUiInteractableComponent._labelGameObject
    UnityUiInteractableComponent._highlightGameObject
    UnityUiInteractableComponent._valueGameObject
    UnityUiInteractableComponent._mainButtonGameObject
    UnityUiInteractableComponent._optionValueUiComponentType
    UnityUiInteractableComponent._decorationsCoroutine
    UnityUiInteractableComponent._buttons
    UnityUiInteractableComponent._isDragging
    UnityUiInteractableComponent._wantsHighlightVisible
    UnityUiInteractableComponent._widthLocked
    UnityUiInteractableComponent.SetupDecorations(bool)
    UnityUiInteractableComponent.AdaptHighlightWidthToText(Image, TMP_Text, RectTransform, float, bool, bool, GameObject)
    UnityUiInteractableComponent.GetHighlightTargetWidth(Image, TMP_Text, RectTransform, float, bool, bool, GameObject)
    UnityUiInteractableComponent.RelocateHighlightImage(Image, TMP_Text, RectTransform, RectTransform)
    UnityUiInteractableComponent.GetHighlightImage(Image, TMP_Text, RectTransform)
    UnityUiInteractableComponent.SetWidthLocked(bool)
    UnityUiInteractableComponent.IsWidthLocked()
    UnityUiInteractableComponent.SetAutoDecorationsEnabled(bool)
    UnityUiInteractableComponent.GetDecorationsPassVersion()
    UnityUiInteractableComponent.RunDecorations(bool)
    UnityUiInteractableComponent.CalculateLogicalWidth()
    UnityUiInteractableComponent.Awake()
    UnityUiInteractableComponent.OnDisable()
    UnityUiInteractableComponent.RefreshLayoutAfterTextChange()
    UnityUiInteractableComponent.IncrementValue()
    UnityUiInteractableComponent.DecrementValue()
    UnityUiInteractableComponent.SetIndex(int)
    UnityUiInteractableComponent.GetIndex()
    UnityUiInteractableComponent.SetIsDragging(bool)
    UnityUiInteractableComponent.GetIsDragging()
    UnityUiInteractableComponent.OnDraggingStart()
    UnityUiInteractableComponent.OnDraggingEnd()
    UnityUiInteractableComponent.Focus()
    UnityUiInteractableComponent.Blur()
    UnityUiInteractableComponent.SelectNextComponent()
    UnityUiInteractableComponent.SelectPreviousComponent()
    UnityUiInteractableComponent.SelectComponentById(string)
    UnityUiInteractableComponent.SetFocus(bool)
    UnityUiInteractableComponent.Initialize(IUiComponentParameters, IUiComponentActions, ILogService)
    UnityUiInteractableComponent.SetFocusAnimation()
    UnityUiInteractableComponent.SetDeselectedAnimation()
    UnityUiInteractableComponent.Submit()
    UnityUiInteractableComponent.Cancel()
    UnityUiInteractableComponent.MapTMPAlignment(UiComponentAlignmentType)
    UnityUiInteractableComponent.InitializeLabel(string)
    UnityUiInteractableComponent.InitializeVisualElement()
    UnityUiInteractableComponent.InitializeVisualElement(UiComponentInteractionType, UiComponentAlignmentType, float, string)
    UnityUiInteractableComponent.InitializeHighlight()
    UnityUiInteractableComponent.AlignElements(UiComponentInteractionType, UiComponentAlignmentType)
    UnityUiInteractableComponent.SetHighlightAlignment(UiComponentAlignmentType)
    UnityUiInteractableComponent.SetLabelAlignment(UiComponentAlignmentType)
    UnityUiInteractableComponent.HandleCenterAlignment(TMP_Text)
    UnityUiInteractableComponent.FlipHorizontally(GameObject)
    UnityUiInteractableComponent.SetValueAlignment(UiComponentInteractionType, UiComponentAlignmentType)
    UnityUiInteractableComponent.InitializeMirroring(UiComponentAlignmentType)
    UnityUiInteractableComponent.SetButtonAlignment(UiComponentAlignmentType)
    UnityUiInteractableComponent.SetElementPosition(float, UiComponentAlignmentType)
    UnityUiInteractableComponent.GetContentWrapperGameObject()
    UnityUiInteractableComponent.SetContentWrapperGameObject(GameObject)
    UnityUiInteractableComponent.GetLabelElement()
    UnityUiInteractableComponent.GetLabelGameObject()
    UnityUiInteractableComponent.SetLabelGameObject(GameObject)
    UnityUiInteractableComponent.SetLabelElement(IFoundationViewElement)
    UnityUiInteractableComponent.GetMainButtonElement()
    UnityUiInteractableComponent.SetMainButtonGameObject(GameObject)
    UnityUiInteractableComponent.GetMainButtonGameObject()
    UnityUiInteractableComponent.SetMainButtonElement(IFoundationViewElement)
    UnityUiInteractableComponent.SetHighlightGameObject(GameObject)
    UnityUiInteractableComponent.GetHighlightElement()
    UnityUiInteractableComponent.GetHighlightGameObject()
    UnityUiInteractableComponent.SetHighlightElement(IFoundationViewElement)
    UnityUiInteractableComponent.GetValueElement()
    UnityUiInteractableComponent.SetValueGameObject(GameObject)
    UnityUiInteractableComponent.GetValueGameObject()
    UnityUiInteractableComponent.SetValueElement(IFoundationViewElement)
    UnityUiInteractableComponent.SetLabelText(string)
    UnityUiInteractableComponent.SetValueText(string)
    UnityUiInteractableComponent.GetButtonElements(bool)
    UnityUiInteractableComponent.GetButtonGameObjects(bool)
    UnityUiInteractableComponent.SetButtonElements(List<IFoundationViewElement>)
    UnityUiInteractableComponent.GetUiComponentInteractionType()
    UnityUiInteractableComponent.SetUiComponentInteractionType(UiComponentInteractionType)
    UnityUiInteractableComponent.InitializeButtons()
    UnityUiInteractableComponent._decorationsInitialized
    UnityUiInteractableComponent.InteractableParameters
    UnityUiInteractableComponent.InteractableActions
    UnityUiInteractableComponent.DecorationsReady
    UnityUiComponent._animators
    UnityUiComponent.UpdateUiElement<T>(Action<T>, IFoundationViewElement)
    Namespace: Serenity.Ui.Infrastructure.Components
    Assembly: Serenity.UnityUi.Infrastructure.dll
    Syntax
    public class UnityUiSliderComponent : UnityUiInteractableComponent, IUiInteractable, IUiComponent, IUiSlideable, IComponent, IFoundationSettings

    Constructors

    UnityUiSliderComponent()

    Initializes a new Unity UI slider component with slider interaction type configuration.
    Sets up the component for range-based value selection operations within the UI system.

    Declaration
    public UnityUiSliderComponent()

    Fields

    _slider

    Declaration
    protected Slider _slider
    Field Value
    Type Description
    Slider

    Properties

    SlideableActions

    Gets or sets the slideable actions interface for range value event handling.
    Manages callbacks for value changes, minimum value changes, and maximum value changes.

    Declaration
    public IUiSlideableActions SlideableActions { get; set; }
    Property Value
    Type Description
    IUiSlideableActions

    The slideable actions interface

    SlideableParameters

    Gets or sets the slideable parameters interface for range configuration.
    Provides access to current value, minimum value, maximum value, and value type settings.

    Declaration
    public IUiSlideableParameters SlideableParameters { get; set; }
    Property Value
    Type Description
    IUiSlideableParameters

    The slideable parameters interface

    Methods

    ChangeMaximumValue(float)

    Changes the maximum allowed value for the slider range.
    Updates both the parameter storage and the Unity Slider component's maximum value.
    Triggers maximum value change callbacks for system integration and state management.

    Declaration
    public virtual void ChangeMaximumValue(float value)
    Parameters
    Type Name Description
    float value

    The new maximum value for the slider range

    ChangeMinimumValue(float)

    Changes the minimum allowed value for the slider range.
    Updates both the parameter storage and the Unity Slider component's minimum value.
    Triggers minimum value change callbacks for system integration and state management.

    Declaration
    public virtual void ChangeMinimumValue(float value)
    Parameters
    Type Name Description
    float value

    The new minimum value for the slider range

    OnEnable()

    Unity lifecycle method called when the component is enabled.
    Calls base initialization for proper component setup and configuration.

    Declaration
    public override void OnEnable()
    Overrides
    UnityUiInteractableComponent.OnEnable()

    SetValue(float)

    Sets the slider value with type-specific formatting and validation.
    Handles integer rounding for INT type and validates value is within the configured range.
    Updates both the Unity Slider component and associated text display with proper formatting.

    Declaration
    public virtual void SetValue(float value)
    Parameters
    Type Name Description
    float value

    The float value to set for the slider

    Exceptions
    Type Condition
    NullReferenceException

    Thrown when SlideableParameters is null

    ArgumentOutOfRangeException

    Thrown when value is outside the configured range

    NullReferenceException

    Thrown when value GameObject or TMP_Text component is missing

    SetValue(string)

    Sets the slider value from a string representation with automatic type parsing.
    Converts the string to float and delegates to the float-based SetValue method.
    Provides string interface compatibility for the abstract base class requirement.

    Declaration
    public override void SetValue(string value)
    Parameters
    Type Name Description
    string value

    The string value to parse and set

    Overrides
    UnityUiInteractableComponent.SetValue(string)

    SetValueFromSlider()

    Declaration
    public virtual void SetValueFromSlider()

    UpdateTextValue(float)

    Declaration
    protected void UpdateTextValue(float value)
    Parameters
    Type Name Description
    float value

    Implements

    IUiInteractable
    IUiComponent
    IUiSlideable
    IComponent
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved