Class SystemConfigurationSettingsCreator
Generates (or updates) the project-wide UnitySystemConfigurationSettings asset from a single description. Mirrors Serenity.GameCamera.Infrastructure.Editor.Builder.GameCameraSettingsCreator: static class, Input/Result DTOs, Validate, Create with created-paths rollback on failure — resolved and folder-provisioned through the shared SettingsAssetAuthoring engine rather than a private copy of its logic.
A second UnitySystemConfigurationSettings asset does not break anything at runtime — the
installer's UnityAssetUtils.LoadAllFromAnyBlocking call loads every asset tagged
module:system-configuration and uses the first one found — so ambiguity here is surfaced as a
warning, never a hard error, exactly like GameCamera's settings creator.
Inherited Members
Namespace: Serenity.SystemConfiguration.Infrastructure.Editor.Builder
Assembly: Serenity.UnitySystemConfiguration.Infrastructure.Editor.dll
Syntax
public static class SystemConfigurationSettingsCreator
Fields
DefaultOutputFolder
Folder a brand-new settings asset is created under when the caller names none.
Declaration
public const string DefaultOutputFolder = "Assets/Game/Media/SystemConfiguration"
Field Value
| Type | Description |
|---|---|
| string |
SettingsAssetFileNameFallback
Fallback file name for the settings asset when Id sanitizes to nothing usable — passed to FileNameSafe(string, string) alongside CreateSystemConfigurationSettingsWindow's own target-section path preview, so both compute the exact same planned file name.
Declaration
public const string SettingsAssetFileNameFallback = "SystemConfigurationSettings"
Field Value
| Type | Description |
|---|---|
| string |
Methods
Create(Input)
Validates the request, maps it onto a throwaway scratch draft, and hands that to
CreateFromDraft(UnitySystemConfigurationSettings, string, string, bool) — the single place that ever writes a field onto the real asset. Kept
for headless/test callers that only have the flat SystemConfigurationSettingsCreator.Input shape (see
SystemConfigurationSettingsCreatorTests); CreateSystemConfigurationSettingsWindow
itself skips this DTO entirely and calls CreateFromDraft(UnitySystemConfigurationSettings, string, string, bool) with its own
SerenityWizardScratchDraft<UnitySystemConfigurationSettings> directly, so there is only
ONE remaining field-by-field mapping in this class (Serenity.SystemConfiguration.Infrastructure.Editor.Builder.SystemConfigurationSettingsCreator.ApplyInputToDraft(Serenity.SystemConfiguration.Infrastructure.Editor.Builder.SystemConfigurationSettingsCreator.Input,Serenity.SystemConfiguration.Infrastructure.Settings.UnitySystemConfigurationSettings)), not two.
Declaration
public static SystemConfigurationSettingsCreator.Result Create(SystemConfigurationSettingsCreator.Input input)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemConfigurationSettingsCreator.Input | input |
Returns
| Type | Description |
|---|---|
| SystemConfigurationSettingsCreator.Result |
CreateFromDraft(UnitySystemConfigurationSettings, string, string, bool)
The single write path: resolves-or-creates the settings asset, then commits every field on
draft onto it via ResolveAndCommit<TSettings>(TSettings, string, string, string, SerenityAssetCreationTransaction)
— serialization decides what gets written, not a hand-maintained field list. This is the same shared
call CreateFromDraft(TSettings, string, string, bool)
uses for the Ui/Menu/Modal singletons — SystemConfiguration cannot instantiate that engine directly
because its own SystemConfigurationSettingsCreator.Input/SystemConfigurationSettingsCreator.Result predate SingletonSettingsInput/
SingletonSettingsResult, so it calls the shared resolve-and-commit step directly instead of
keeping a second copy of it. On any failure every mutation is rolled back through the transaction's
existing-asset restore. Without a labeled asset anywhere in the project,
Serenity.SystemConfiguration.Installation.Installers.UnitySystemConfigurationInstaller
throws at boot — this wizard exists specifically to prevent that.
Declaration
public static SystemConfigurationSettingsCreator.Result CreateFromDraft(UnitySystemConfigurationSettings draft, string explicitSettingsAssetPath, string newSettingsFolderPath, bool registerAsAddressables)
Parameters
| Type | Name | Description |
|---|---|---|
| UnitySystemConfigurationSettings | draft | Every field to write, already resolved (an already-seeded scratch draft from an
existing asset for an update-in-place run, or a freshly populated one for a create). Its own
Guid is ignored on purpose — identity is owned by
ResolveAndCommit<TSettings>(TSettings, string, string, string, SerenityAssetCreationTransaction), the same rule |
| string | explicitSettingsAssetPath | Explicit target path (a test seam and an already-known-asset fast path) — see SettingsAssetPath. |
| string | newSettingsFolderPath | Folder a brand-new asset is created under when none exists. |
| bool | registerAsAddressables | Whether to register a newly created asset as Addressable. |
Returns
| Type | Description |
|---|---|
| SystemConfigurationSettingsCreator.Result |
ResolveSettingsContext(string)
Thin wrapper over the shared ResolveSettingsContext<TSettings>(string, string), exposed so CreateSystemConfigurationSettingsWindow can auto-detect the project-wide singleton for its "Edit existing" field.
Declaration
public static SettingsAssetAuthoring.SettingsResolution<UnitySystemConfigurationSettings> ResolveSettingsContext(string explicitSettingsAssetPath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | explicitSettingsAssetPath |
Returns
| Type | Description |
|---|---|
| SettingsResolution<UnitySystemConfigurationSettings> |
Validate(Input)
Validates the request: a non-empty Id, either a resolvable existing asset or a well-formed destination folder for a fresh one, the same three field predicates UnitySystemConfigurationSettingsEditor warns/errors about on its live inspector (polling enabled with a non-positive interval; a primary display index outside the currently connected display count; disk persistence enabled with an empty JSON file name), and every authored Sync Map row's target key against the project's UnityGameSettingsDefinition Ids (a warning when unresolved — the definition may be authored later — never a hard error).
Declaration
public static SerenityCreationValidationResult Validate(SystemConfigurationSettingsCreator.Input input)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemConfigurationSettingsCreator.Input | input |
Returns
| Type | Description |
|---|---|
| SerenityCreationValidationResult |