Class SettingsAssetDraftCommit
The one shared "resolve-or-create the settings asset, then commit a draft's every field onto it" sequence
behind every draft-based settings wizard. CreateFromDraft(TSettings, string, string, bool)
calls this directly; so do the three hand-rolled creators whose own pre-resolution steps (a
package-content move, per-key definition authoring, Id/key trimming) do not fit that engine's generic
shape and therefore cannot instantiate it —
Serenity.SystemConfiguration.Infrastructure.Editor.Builder.SystemConfigurationSettingsCreator,
Serenity.GameCamera.Infrastructure.Editor.Builder.GameCameraSettingsCreator and
Serenity.GameGraphics.Installation.Settings.Editor.Builder.GameGraphicsSettingsCreator.
Every caller still owns its OWN Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction, its own commit/rollback, its own Addressables module label, and any step that has to run before or after this one (a move, extra assets, RecordOnto(SerenityCreationResult)) — this collaborator only resolves the settings asset and writes the draft onto it, exactly the part that never differs between callers.
Inherited Members
Namespace: Serenity.StructuredPersistence.Infrastructure.Editor.Authoring
Assembly: Serenity.UnityStructuredPersistence.Infrastructure.Editor.dll
Syntax
public static class SettingsAssetDraftCommit
Methods
ResolveAndCommit<TSettings>(TSettings, string, string, string, SerenityAssetCreationTransaction)
Resolves the settings asset named by explicitSettingsAssetPath (or plans a new
one under newSettingsFolderPath/fallbackFileName when none
exists), then commits draft onto it through the shared
Serenity.StructuredPersistence.Infrastructure.Editor.Authoring.SettingsAssetCommitCore.Commit``1(``0,``0,``0,System.String,Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction) tail — identity rule, field copy, and the
update-only disk verification are identical to SettingsAssetByIdDraftCommit's own
commit, so only the resolution step (an explicit/singleton path, here, vs. by Id within a folder
there) differs between the two. Tracks the resolved/created asset on transaction,
but never commits or rolls it back — that stays the caller's own responsibility, since only the
caller knows what else belongs in the same transaction.
Declaration
public static SettingsAssetDraftCommitOutcome ResolveAndCommit<TSettings>(TSettings draft, string explicitSettingsAssetPath, string newSettingsFolderPath, string fallbackFileName, SerenityAssetCreationTransaction transaction) where TSettings : ScriptableObject
Parameters
| Type | Name | Description |
|---|---|---|
| TSettings | draft | Every field to write: 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 — this call owns identity regardless of what the draft already carried. |
| string | explicitSettingsAssetPath | Explicit target path — empty resolves the project-wide singleton. |
| string | newSettingsFolderPath | Folder a brand-new asset is created under when none exists. |
| string | fallbackFileName | File name used when the caller names none — already sanitized by the caller. |
| SerenityAssetCreationTransaction | transaction | The caller's own transaction — this call tracks the resolved/created asset on it. |
Returns
| Type | Description |
|---|---|
| SettingsAssetDraftCommitOutcome |
Type Parameters
| Name | Description |
|---|---|
| TSettings |