logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityMenuSettingsDefinition

    Unity ScriptableObject implementation of IMenuSettingsDefinition that defines menu configuration.
    Provides settings for menu layout, options, alignment, and event handling through Unity's inspector.

    Inheritance
    object
    UnityMenuSettingsDefinition
    Implements
    IMenuSettingsDefinition
    IViewDefinition
    IFoundationSettings
    IScrollableViewDefinition
    Namespace: Serenity.Menu.Infrastructure.Settings
    Assembly: Serenity.UnityMenu.Infrastructure.dll
    Syntax
    public class UnityMenuSettingsDefinition : UnityViewDefinition, IMenuSettingsDefinition, IViewDefinition, IFoundationSettings, IScrollableViewDefinition

    Constructors

    UnityMenuSettingsDefinition()

    Declaration
    public UnityMenuSettingsDefinition()

    Fields

    Direction

    Declaration
    public MenuDirection Direction
    Field Value
    Type Description
    MenuDirection

    The axis along which options are laid out. Vertical (value 0) stacks options top-to-bottom (the historical behavior); Horizontal places them side by side. Defaults to Vertical so existing assets preserve their layout.

    EventToDispatchOnSubmit

    Declaration
    public EventDispatcherSignal EventToDispatchOnSubmit
    Field Value
    Type Description
    EventDispatcherSignal

    The event dispatcher signal to trigger when a menu option is submitted.

    HorizontalOptionWidth

    Declaration
    public float HorizontalOptionWidth
    Field Value
    Type Description
    float

    The option width in canvas units used when HorizontalOptionWidthMode is EXPLICIT.

    HorizontalOptionWidthMode

    Declaration
    public HorizontalOptionWidthMode HorizontalOptionWidthMode
    Field Value
    Type Description
    HorizontalOptionWidthMode

    How option columns are sized for a Horizontal menu. CONTENT (default) keeps each option's own content width (may overflow); UNIFORM uses the widest content width capped to fit the visible columns on screen; FILL gives each visible option an equal share of the available width; EXPLICIT uses HorizontalOptionWidth. Ignored for Vertical menus.

    InstantiationMode

    Declaration
    public MenuInstantiationMode InstantiationMode
    Field Value
    Type Description
    MenuInstantiationMode

    Controls when this menu's visual instance is created. Configuration-only in this iteration; defaults to PreloadOnStartup (value 0) so existing assets preserve the current eager-construction behavior. Not yet honored by any runtime code.

    IsTranslatingTitle

    Declaration
    public bool IsTranslatingTitle
    Field Value
    Type Description
    bool

    Whether the title is being translated.

    OnCancel

    Declaration
    public List<EventDispatcherSignal> OnCancel
    Field Value
    Type Description
    List<EventDispatcherSignal>

    Event dispatcher signals to fire when the cancel input is not consumed by the selected option.

    OnHide

    Declaration
    public List<EventDispatcherSignal> OnHide
    Field Value
    Type Description
    List<EventDispatcherSignal>

    Event dispatcher signals to fire when the menu transitions to the hidden state.

    OnShow

    Declaration
    public List<EventDispatcherSignal> OnShow
    Field Value
    Type Description
    List<EventDispatcherSignal>

    Event dispatcher signals to fire when the menu transitions to the shown state.

    OptionAlignment

    Declaration
    public UiComponentAlignmentType OptionAlignment
    Field Value
    Type Description
    UiComponentAlignmentType

    The alignment type for individual options within the menu.

    Options

    Declaration
    public UiOption[] Options
    Field Value
    Type Description
    UiOption[]

    Array of UI options that comprise this menu's selectable items.

    OptionsGap

    Declaration
    public float OptionsGap
    Field Value
    Type Description
    float

    The gap spacing between menu options in Unity units.

    Title

    Declaration
    public string Title
    Field Value
    Type Description
    string

    The title of the menu.

    TitleGap

    Declaration
    public float TitleGap
    Field Value
    Type Description
    float

    The gap spacing between the title and the options in Unity units.

    ViewAlignment

    Declaration
    public UiAnchorType ViewAlignment
    Field Value
    Type Description
    UiAnchorType

    The anchor type that determines how the view is aligned relative to its container. Renamed from MenuAlignment; existing assets migrate via FormerlySerializedAs.

    VisibleOptionsCount

    Declaration
    public int VisibleOptionsCount
    Field Value
    Type Description
    int

    Number of options visible at once when Scrollable is on. When the menu has more options than this, the options area clamps to this many rows and the rest scroll. Zero or less disables clamping.

    Methods

    ToString()

    Returns a detailed string representation of this menu settings definition.
    Includes all configuration properties and options for debugging and logging purposes.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A formatted string containing all menu configuration details.

    Implements

    IMenuSettingsDefinition
    IViewDefinition
    IFoundationSettings
    IScrollableViewDefinition
    In this article
    © 2026 Serenity. All Rights Reserved