logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.GameSettings.Infrastructure.Services

    Classes

    UnityGameSettingsAssetPreloader

    Progressive asset preloader for menu-based game settings.

    SYSTEM DESIGN: This component implements progressive asset preloading for Unity game menus to create a fluid user experience. It analyzes UnityGameSettingsDefinition configurations and predictively preloads assets that users are likely to select.

    PRELOADING STRATEGIES:

    • SELECTABLE Components: Preloads current + neighbor values (sliding window: i-1, i, i+1)
    • DROPDOWN Components: Preloads current page elements (5 visible options around selection)
    • SLIDER/TOGGLE Components: Preloads current value only

      MEMORY MANAGEMENT:
    • Context-based asset separation to prevent conflicts
    • Automatic cleanup when leaving menu sections
    • Configurable limits for concurrent preloads

      INTEGRATION POINTS:
    • Menu lifecycle events (display, selection change, value submission)
    • IAssetPrefetcherApp service for actual preloading operations
    • IGameSettingsService for menu configuration data

      NOTE: This is a design template. Full implementation requires proper assembly references to Serenity.AssetPrefetcher.Application and Serenity.Ui.Domain assemblies.

    UnityGameSettingsAssetPreloadingIntegrator

    Integration component that connects menu lifecycle events with progressive asset preloading.

    SYSTEM DESIGN:
    This component listens to menu display and interaction events to trigger appropriate preloading strategies. It acts as the glue between the menu system and the progressive asset preloader.

    EVENT INTEGRATION:

    • Menu Display: Triggers initial menu analysis and preloading
    • Selection Change: Updates neighbor preloading based on current selection
    • Value Submission: Triggers preloading for newly selected values
    • Menu Exit: Releases associated assets to free memory

      PRELOADING TRIGGERS:
    • OnMenuDisplayed(): Analyzes entire menu and preloads all discoverable assets
    • OnSelectionChanged(): Updates sliding window preloading around current selection
    • OnValueSubmitted(): Preloads assets for newly confirmed values
    • OnMenuExited(): Cleans up all menu-related preloaded assets

      NOTE: This is a design template. Full implementation requires proper assembly references to access UiOption, MenuDisplayEvent, and other domain types.

    UnityGameSettingsFactory

    Factory class for creating GameSettings entities from game settings definitions.
    Provides Unity-specific implementation of the IGameSettingsFactory interface for converting definition objects into concrete GameSettings instances.

    UnityGameSettingsService

    Unity-specific implementation of game settings service using MonoBehaviour with persistent storage.
    Manages game settings dictionary with type-safe value operations (string, int, float, bool), event dispatching for settings changes, and file-based persistence through PersistenceUseCases.
    Provides initialization with logging, persistence, and path services for Unity applications with foundation settings identification and Unity editor integration.

    UnityGameSettingsServiceFactory

    Factory class for creating Unity game settings service instances.
    Creates and configures UnityGameSettingsService with required dependencies, game settings data, and proper Unity GameObject setup.

    In this article
    © 2026 Serenity. All Rights Reserved