logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class GameGraphicsSettingsCreator

    Generates (or updates) the UnityGameGraphicsSettings singleton — the asset holding the three binding keys (QualityLevelKey, ScreenResolutionKey, IsFullScreenKey) and the four Default* fields.

    The four Default* fields were a live, verified first-run defect — now repaired, not merely cosmetic. The project's own UnityGameGraphicsSettingsEditorEditor inspector never rendered them, and — confirmed live in the open editor — the shipped Assets/Serenity/Media/GameGraphics/GameGraphicsSettings.asset had shipped with them entirely absent from its YAML: DefaultQualityLevel loaded null, DefaultResolutionWidth/ DefaultResolutionHeight loaded 0, DefaultIsFullScreen loaded false — and UnityGameGraphicsService consumes every one of them unconditionally. That shipped asset has been repaired as part of this change (its YAML now serializes all four fields with the class's intended defaults). Every asset this wizard creates or updates writes all eight fields unconditionally (see Serenity.GameGraphics.Installation.Settings.Editor.Builder.GameGraphicsSettingsCreator.ApplyFields(Serenity.GameGraphics.Installation.Settings.Editor.Builder.GameGraphicsSettingsCreator.Input,Serenity.GameGraphics.Installation.Settings.UnityGameGraphicsSettings,System.String,System.String,System.String)) precisely so a wizard-touched asset can never carry this gap again. This is the first dedicated creation wizard for the GameGraphics aggregate.

    Resolution mirrors Serenity.Logging.Infrastructure.Editor.Builder.LoggingProfileCreator's two sink settings, not its UnityLogProfile. Verified by reading both Install(GameGraphicsInstallerInstallInput) and Serenity.Installation.UnitySerenityInstaller.InstallGameGraphics: the installer only ever receives a base GameGraphicsInstallerInstallInput from the composition root — never the Unity subclass carrying a direct UnityGameGraphicsSettings reference — so the is branch in Install that would honor a direct assignment is dead in production today, even though UnitySerenityInstaller exposes a GameGraphicsSettings field. Resolution therefore falls through unconditionally to UnityAssetUtils.LoadAllFromAnyBlocking<UnityGameGraphicsSettings> over the GAME_GRAPHICS label, taking the first match — a project-wide singleton exactly like Logging's two sinks, so ambiguity (more than one existing asset) is a warning, never an error, resolved through the same shared SettingsAssetAuthoring engine. This is a real, verified gap in UnitySerenityInstaller (the field is unreachable dead wiring) — reported here, not fixed, per this change's scope.

    The three binding keys are plain strings, not object references — they must equal the IFoundationSettings.Id of a UnityGraphicGameSettingsDefinition the GameSettings module discovers via the GAME_SETTINGS label (UnityGameSettingsInstaller.Install loads every UnityGameSettingsDefinition — the base type, so a UnityGraphicGameSettingsDefinition instance qualifies — tagged that label; it silently no-ops, rather than throwing, when none are found). UnityGameSettingsService keys its runtime lookup with a plain Dictionary<string, GameSettingsEntity> — the default (ordinal, case-sensitive) comparer — so key resolution below matches Ids ordinally, not case-insensitively. Only QualityLevel's key is validated as an error (mirroring UnityGameGraphicsInstaller's own ValidateSettings, which throws on an empty/null QualityLevelKey and nothing else); an unresolved or empty key for any of the three is a warning, since the installer does not validate that a key actually resolves to an existing definition at all — only that QualityLevelKey is non-empty.

    "Create missing definition" only ever creates, never duplicates. Per key, when the flag is set and no existing UnityGraphicGameSettingsDefinition resolves that Id anywhere in the project, this run authors one directly (constructing the type is safe from an isolated editor assembly — unlike the GameSettings module's own generic GameSettingCreator, which folds into Serenity.UnityGlobal.Infrastructure.Editor and is built for authoring an arbitrary UnityGameSettingsDefinition of a caller-chosen Type one at a time — a shape this wizard's three-keys-in-one-run authoring does not fit), labeled GAME_SETTINGS so the GameSettings module actually discovers it. When a matching definition already exists, the flag is a documented no-op (see Serenity.GameGraphics.Installation.Settings.Editor.Builder.GameGraphicsSettingsCreator.ValidateKeyResolution(Serenity.GameGraphics.Installation.Settings.Editor.Builder.GameGraphicsSettingsCreator.KeyBindingInput,System.String,Serenity.GameGraphics.Installation.Settings.Editor.Builder.GameGraphicsSettingsCreator.Input,Serenity.Global.Infrastructure.Editor.SerenityCreationValidationResult)) — this wizard never creates a second definition sharing an Id.

    CreateGameGraphicsSettingsWindow only collects input and renders results; every asset mutation lives here.
    Inheritance
    object
    GameGraphicsSettingsCreator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameGraphics.Installation.Settings.Editor.Builder
    Assembly: Serenity.UnityGraphicsSettings.Installation.Editor.dll
    Syntax
    public static class GameGraphicsSettingsCreator

    Methods

    Create(Input)

    Validates the request, then resolves-or-creates each key's backing definition (only when its "create missing" flag is set and nothing already resolves it), then resolves-or-creates the UnityGameGraphicsSettings singleton itself. On any failure every mutation is rolled back: created assets/folders are deleted, their Addressables entries removed, and an already-existing settings asset's pre-call field values are restored.

    Declaration
    public static GameGraphicsSettingsCreator.Result Create(GameGraphicsSettingsCreator.Input input)
    Parameters
    Type Name Description
    GameGraphicsSettingsCreator.Input input
    Returns
    Type Description
    GameGraphicsSettingsCreator.Result

    Validate(Input)

    Validates the request: a well-formed output folder, a non-empty QualityLevel.Key (the only one of the three keys UnityGameGraphicsInstaller itself validates), each key's resolution against existing UnityGraphicGameSettingsDefinition Ids (warnings), and the same resolve-or-edit ambiguity Create(Input) would act on for the settings singleton.

    Declaration
    public static SerenityCreationValidationResult Validate(GameGraphicsSettingsCreator.Input input)
    Parameters
    Type Name Description
    GameGraphicsSettingsCreator.Input input
    Returns
    Type Description
    SerenityCreationValidationResult
    In this article
    © 2026 Serenity. All Rights Reserved