Class CharacterConfigCreator
Generates (or updates) a single CharacterConfigSO archetype asset from a validated wizard
input. Mirrors Serenity.AssetPrefetcher.Infrastructure.Editor.Builder.PrefetchPolicyCreator's
per-profile shape: static class, Input/Result DTOs, Validate/Create/Preview, created-paths rollback on
failure — folder-shape validation and provisioning borrowed from the shared
SettingsAssetAuthoring engine rather than a private copy of that logic.
Unlike a project-wide settings singleton, CharacterConfigSO assets are explicitly multi-instance
by design — UnityCharacterInstaller loads every asset tagged type:character and applies all
of them, one per archetype. There is no project-wide "the one" asset to resolve: each archetype resolves
independently to an existing asset with a matching Id already living in
FolderPath (updated in place) or a brand-new asset created there — mirroring
PrefetchPolicyCreator's per-profile resolution, not GameCameraSettingsCreator's singleton one.
CreateCharacterWindow only collects input and renders results; every asset mutation lives
here.
Inheritance
CharacterConfigCreator
Assembly: Serenity.UnityCharacter.Infrastructure.Editor.dll
Syntax
public static class CharacterConfigCreator
Methods
Validates the request, then resolves-or-creates the archetype asset, applies every field, and
authors Mount (see Serenity.Character.Infrastructure.Editor.Builder.CharacterConfigCreator.AuthorMount(Serenity.Character.Infrastructure.Editor.Builder.CharacterConfigCreator.Input)). On any failure every mutation is
rolled back: a freshly created asset (and any folder it provisioned) is deleted and its Addressables
entry removed; an already-existing asset that was being edited has its pre-call field values
restored; a GameRail mutation on the Prefab is undone the same way (see
Serenity.Character.Infrastructure.Editor.Builder.CharacterConfigCreator.RollBackMount(Serenity.Character.Infrastructure.Editor.Builder.CharacterConfigCreator.MountAuthoringOutcome)).
Declaration
public static CharacterConfigCreator.Result Create(CharacterConfigCreator.Input input)
Parameters
Returns
Computes what Create(Input) would do without mutating the project — the same
resolution helper, read-only.
Declaration
public static CharacterConfigCreator.PreviewResult Preview(CharacterConfigCreator.Input input)
Parameters
Returns
Validates the request: a non-empty Id, a well-formed destination folder,
MaxHealth >= 1 (the only field the domain CharacterConfig constructor
actually throws on — every other numeric field below is a Unity inspector [Min]/[Range]
hint the domain never enforces, so a violation there is a warning, not a blocking error), and — an
ERROR, not a warning — an existing CharacterConfigSO in FolderPath
whose Id differs from Id only by letter case (see
Serenity.Global.Infrastructure.Editor.SerenityAssetIdRules.RejectCaseVariantInFolder``1(Serenity.Global.Infrastructure.Editor.SerenityAssetIdLookup.IdMatches{``0},System.String,System.String,System.String,Serenity.Global.Infrastructure.Editor.SerenityCreationValidationResult): two such Ids would collide
on the same case-insensitive asset FILE NAME on disk). Also warns (never blocks) when: no
Prefab is assigned (mirrors UnityCharacterInstaller's own boot-time
warning — the archetype imports but cannot be instantiated); or another CharacterConfigSO
elsewhere in the project already carries the same Id, exactly (see
WarnAboutDuplicateIdElsewhere) or by case-variant (see
Serenity.Global.Infrastructure.Editor.SerenityAssetIdRules.WarnAboutCaseVariantElsewhere``1(Serenity.Global.Infrastructure.Editor.SerenityAssetIdLookup.IdMatches{``0},System.String,System.String,Serenity.Global.Infrastructure.Editor.SerenityCreationValidationResult)) — both scoped to
DuplicateIdSearchFolder.
Declaration
public static SerenityCreationValidationResult Validate(CharacterConfigCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|