logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityUiSelectorComponent

    Unity UI selector component that provides option selection functionality with multiple value type support.
    Extends the submit component to handle array-based value selection including string, integer, and float types.
    Implements IUiSelectable interface for comprehensive option selection and value management within the Unity UI system.

    Inheritance
    object
    UnityUiComponent
    UnityUiInteractableComponent
    UnityUiSubmitComponent
    UnityUiSelectorComponent
    UnityUiDropdownComponent
    Implements
    IUiInteractable
    IUiComponent
    IUiSubmittable
    IUiSelectable
    IComponent
    IFoundationSettings
    Inherited Members
    UnityUiSubmitComponent.Submit()
    UnityUiSubmitComponent.InitializeVisualElement()
    UnityUiSubmitComponent.SubmittableActions
    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.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.Cancel()
    UnityUiInteractableComponent.MapTMPAlignment(UiComponentAlignmentType)
    UnityUiInteractableComponent.InitializeLabel(string)
    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 UnityUiSelectorComponent : UnityUiSubmitComponent, IUiInteractable, IUiComponent, IUiSubmittable, IUiSelectable, IComponent, IFoundationSettings

    Constructors

    UnityUiSelectorComponent()

    Initializes a new Unity UI selector component with selector interaction type configuration.
    Sets up the component for option selection operations within the UI system.

    Declaration
    public UnityUiSelectorComponent()

    Properties

    SelectableActions

    Gets or sets the selectable actions interface for option selection event handling.
    Manages callbacks for value changes and selectable values configuration updates.

    Declaration
    public IUiSelectableActions SelectableActions { get; set; }
    Property Value
    Type Description
    IUiSelectableActions

    The selectable actions interface

    SelectableParameters

    Gets or sets the selectable parameters interface for option configuration.
    Provides access to selectable values array, selected index, and value type settings.

    Declaration
    public IUiSelectableParameters SelectableParameters { get; set; }
    Property Value
    Type Description
    IUiSelectableParameters

    The selectable parameters interface

    Methods

    DecrementValue()

    Decrements the selected option index with wraparound functionality.
    Moves to the previous option in the array, wrapping to the last option when reaching the beginning.
    Calls base decrement functionality for additional UI system integration.

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

    GetSelectedValue()

    Retrieves the currently selected value from the selectable values array.
    Returns null if the selected index is invalid or outside the array bounds.
    Provides safe access to the current selection state for external components.

    Declaration
    public virtual ConfigurationEntry GetSelectedValue()
    Returns
    Type Description
    ConfigurationEntry

    The currently selected KeyValuePair or null if selection is invalid

    IncrementValue()

    Increments the selected option index with wraparound functionality.
    Moves to the next option in the array, wrapping to the first option when reaching the end.
    Calls base increment functionality for additional UI system integration.

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

    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
    UnityUiSubmitComponent.OnEnable()

    SetFloatValue(float)

    Sets a float value directly without array indexing for numeric selector types.
    Updates the selected value in the array and refreshes the UI display with the new float value.
    Triggers value change callbacks for system integration and state management.

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

    The float value to set directly

    SetIntValue(int)

    Sets an integer value directly without array indexing for numeric selector types.
    Updates the selected value in the array and refreshes the UI display with the new numeric value.
    Triggers value change callbacks for system integration and state management.

    Declaration
    public virtual void SetIntValue(int value)
    Parameters
    Type Name Description
    int value

    The integer value to set directly

    SetSelectableValues(ConfigurationEntry[])

    Updates the selectable values array and refreshes the component state.
    Validates the array is not empty and adjusts the selected index if necessary.
    Triggers selectable values change callbacks and updates the UI display to reflect the new options.

    Declaration
    public virtual void SetSelectableValues(ConfigurationEntry[] selectableValues)
    Parameters
    Type Name Description
    ConfigurationEntry[] selectableValues

    The new array of selectable key-value pairs

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the selectableValues array is empty

    SetValue(int)

    Sets the selected option by its index in the selectable values array.
    Updates the UI display with localized text and triggers value change callbacks.
    Handles empty or null arrays gracefully by clearing the display and resetting the selected index.

    Declaration
    public virtual void SetValue(int index)
    Parameters
    Type Name Description
    int index

    The zero-based index of the option to select

    SetValue(string)

    Sets the selector value from a string representation with automatic type parsing.
    Handles integer and float value types with appropriate parsing and delegates to index-based selection.
    Falls back to integer parsing for default behavior when type detection fails.

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

    The string value to parse and set

    Overrides
    UnityUiSubmitComponent.SetValue(string)

    Implements

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