Namespace Serenity.GameGraphics.Installation.Settings.Editor.Builder
Classes
CreateGameGraphicsSettingsWindow
Step-by-step window for creating or updating the UnityGameGraphicsSettings singleton and, optionally, any of its three backing UnityGraphicGameSettingsDefinition assets that do not exist yet. Mirrors Serenity.Logging.Infrastructure.Editor.Builder.CreateLoggingProfileWindow's shape: the window only collects input and renders results, GameGraphicsSettingsCreator does the actual validation and generation work.
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.
GameGraphicsSettingsCreator.Input
Everything needed to create or update the UnityGameGraphicsSettings asset, and optionally its three backing UnityGraphicGameSettingsDefinition assets.
GameGraphicsSettingsCreator.KeyBindingInput
One of the three binding-key rows: the key string itself, and — optionally — the shape of a brand-new UnityGraphicGameSettingsDefinition to author when nothing resolves it.
GameGraphicsSettingsCreator.Result
Outcome of a Create(Input) call.