logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityModalSettings

    Unity ScriptableObject for configuring modal dialog settings and parameters.
    Provides editor interface for defining modal content, appearance, and behavior.
    Integrates with Unity's CreateAssetMenu system and supports signal-based modal triggering.
    Implements both IUiShowModalParameters and IFoundationSettings interfaces for system integration.

    Inheritance
    object
    UnityModalSettings
    Implements
    IUiShowModalParameters
    IFoundationSettings
    Namespace: Serenity.Modal.Installation.Settings
    Assembly: Serenity.UnityModal.Installation.dll
    Syntax
    public class UnityModalSettings : ScriptableObject, IUiShowModalParameters, IFoundationSettings

    Constructors

    UnityModalSettings()

    Declaration
    public UnityModalSettings()

    Fields

    showModalParameters

    Declaration
    public UnityUiShowModalParameters showModalParameters
    Field Value
    Type Description
    UnityUiShowModalParameters

    signalTypeName

    Declaration
    public string signalTypeName
    Field Value
    Type Description
    string

    Properties

    Alignment

    Gets or sets the alignment configuration for modal content elements.

    Declaration
    public UiComponentAlignmentType Alignment { get; set; }
    Property Value
    Type Description
    UiComponentAlignmentType

    The alignment type for modal content elements.

    Buttons

    Gets or sets the list of button configurations for the modal dialog. Deprecated in favor of Options.

    Declaration
    public List<SerializedComponentData> Buttons { get; set; }
    Property Value
    Type Description
    List<SerializedComponentData>

    The list of button configurations for the modal dialog.

    Direction

    Gets or sets the axis along which the modal lays out its options.

    Declaration
    public ModalDirection Direction { get; set; }
    Property Value
    Type Description
    ModalDirection

    The modal layout direction.

    DisplaySignalType

    Gets a user-friendly display name for the configured signal type.
    Returns "<None>" if no signal is configured, "<Invalid>" if the type cannot be resolved.

    Declaration
    public string DisplaySignalType { get; }
    Property Value
    Type Description
    string

    Guid

    Gets or sets the globally unique identifier for this modal settings instance.

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

    The globally unique identifier for this modal settings instance.

    Id

    Gets or sets the unique identifier for this modal settings instance.

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

    The unique identifier for this modal settings instance.

    IsTranslatingText

    Gets or sets whether the text is treated as a localization key and translated at runtime.

    Declaration
    public bool IsTranslatingText { get; set; }
    Property Value
    Type Description
    bool

    true when the text should be localized.

    IsTranslatingTitle

    Gets or sets whether the title is treated as a localization key and translated at runtime.

    Declaration
    public bool IsTranslatingTitle { get; set; }
    Property Value
    Type Description
    bool

    true when the title should be localized.

    Options

    Gets or sets the rich options for the modal (sliders, toggles, selectors, submits).

    Declaration
    public UiOption[] Options { get; set; }
    Property Value
    Type Description
    UiOption[]

    The options for the modal, modelled exactly like menu options.

    OptionsGap

    Gets or sets the spacing between consecutive options.

    Declaration
    public float OptionsGap { get; set; }
    Property Value
    Type Description
    float

    The gap applied between options.

    Scrollable

    Gets or sets whether the options area clamps to VisibleOptionsCount and scrolls.

    Declaration
    public bool Scrollable { get; set; }
    Property Value
    Type Description
    bool

    true when the modal options area should scroll.

    ShowModalParameters

    Gets or sets the modal parameters containing all configuration data.
    Automatically casts between the base and Unity-specific parameter types.

    Declaration
    public UiShowModalParameters ShowModalParameters { get; set; }
    Property Value
    Type Description
    UiShowModalParameters

    The UnityUiShowModalParameters instance.

    SignalTypeName

    Gets or sets the fully qualified type name of the event signal that triggers this modal.

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

    Text

    Gets or sets the body text content displayed in the modal dialog.

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

    The body text content of the modal dialog.

    Title

    Gets or sets the title text displayed in the modal dialog.

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

    The title text of the modal dialog.

    VisibleOptionsCount

    Gets or sets how many options are visible at once when Scrollable is on.

    Declaration
    public int VisibleOptionsCount { get; set; }
    Property Value
    Type Description
    int

    The number of options visible before scrolling; 0 or less disables clamping.

    Methods

    GetSerializedButtons()

    Gets the serialized button data for the modal dialog.
    Provides access to button configuration for external systems.

    Declaration
    public List<SerializedComponentData> GetSerializedButtons()
    Returns
    Type Description
    List<SerializedComponentData>

    A list of serialized button component data.

    GetSignalInstance()

    Creates an instance of the configured signal type for event system integration.
    Validates that the type exists and is assignable from EventDispatcherSignal.
    Returns null if the signal type is not configured or cannot be resolved.

    Declaration
    public EventDispatcherSignal GetSignalInstance()
    Returns
    Type Description
    EventDispatcherSignal

    An instance of the configured signal type, or null if invalid.

    Remarks

    Note: This ScriptableObject uses Debug.LogWarning as fallback since ILogService is not easily injectable into assets. This warning is important for developers to identify misconfigured modal signal types.

    ToString()

    Returns a string representation of the modal settings configuration.
    Includes ID, GUID, title, text, alignment, and button count for debugging purposes.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A formatted string describing the modal settings.

    Implements

    IUiShowModalParameters
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved