logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityModalOptionsBuilder

    Builds the interactable components for a modal from its rich UiOption array, the modal counterpart of UnityMenuOptionsBuilder. Each option is rendered via UnityModalOptionComponentCreator, seeded with its initial game-settings value (identical to menus), and visually initialized; the resulting IUiInteractable list is handed to the modal component, which parents and lays it out. Replaces the submit-only UnityModalButtonFactory.

    Inheritance
    object
    UnityModalOptionsBuilder
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Modal.Infrastructure.Factories
    Assembly: Serenity.UnityModal.Infrastructure.dll
    Syntax
    public class UnityModalOptionsBuilder

    Constructors

    UnityModalOptionsBuilder(UnityModalOptionComponentCreator, IGameSettingsService, ILogService)

    Declaration
    public UnityModalOptionsBuilder(UnityModalOptionComponentCreator componentCreator, IGameSettingsService gameSettingsService, ILogService logService)
    Parameters
    Type Name Description
    UnityModalOptionComponentCreator componentCreator
    IGameSettingsService gameSettingsService
    ILogService logService

    Methods

    CreateModalOptions(IReadOnlyList<UiOption>, IUiThemeDefinition)

    Creates the modal's interactable components from its options, seeding initial values into game settings (so value options reflect their persisted state) and initializing each option's visuals.

    Declaration
    public List<IUiInteractable> CreateModalOptions(IReadOnlyList<UiOption> options, IUiThemeDefinition theme)
    Parameters
    Type Name Description
    IReadOnlyList<UiOption> options

    The modal options to render; null yields an empty list.

    IUiThemeDefinition theme

    The active UI theme providing the per-interaction prefab templates.

    Returns
    Type Description
    List<IUiInteractable>

    The interactables, in option order, ready to be parented into the modal.

    In this article
    © 2026 Serenity. All Rights Reserved