Class AudioPlayerSettingsCreator
Generates (or updates) one UnityAudioPlayerSettings asset — a Serenity audio channel —
from validated input, resolved by Id within OutputFolderPath.
Mirrors Serenity.Character.Infrastructure.Editor.Builder.CharacterConfigCreator's
per-instance shape: static class, Input/Result DTOs, ValidateIdentity/Validate/Create, transaction-based
rollback on failure.
Absorbs the duplicate channel-creation path that used to live on
Serenity.SoundMixer.Infrastructure.RelationshipManager.Editor.AudioChannelCreator, which
resolved same-Id clashes via UnityEditor.AssetDatabase.GenerateUniqueAssetPath(System.String) — silently producing a
second Foo 1.asset instead of editing the channel the author meant. Routing both the Relationship
Manager's Create Channel section and any future wizard through
ResolveOrCreateByIdInFolder<TSettings>(string, string, string, SerenityAssetCreationTransaction, out bool) means the same Id in the
same folder always updates the one asset in place.
Inheritance
AudioPlayerSettingsCreator
Assembly: Serenity.UnityAudioPlayer.Infrastructure.Editor.dll
Syntax
public static class AudioPlayerSettingsCreator
Fields
DefaultOutputFolder
Folder a new channel's settings asset is created under when the caller names none — the
exact folder AudioChannelCreator.DefaultChannelOutputFolder already pointed at, kept as one
declaration so the Relationship Manager and any future wizard land in the same place.
Declaration
public const string DefaultOutputFolder = "Assets/Game/Media/AudioPlayer"
Field Value
MinimumChannels
Fewest channels a settings asset may declare (public — the wizard window clamps its input
to this same bound).
Declaration
public const uint MinimumChannels = 1
Field Value
Methods
Declaration
public static AudioPlayerSettingsCreator.Result Create(AudioPlayerSettingsCreator.Input input)
Parameters
Returns
The single write path: resolves-or-creates the channel settings asset BY ID WITHIN
input's output folder and commits every field draft carries
onto it via ResolveAndCommit<TSettings>(TSettings, string, string, string, SerenityAssetCreationTransaction) — serialization
decides what gets written, not a hand-maintained field list, so a field the wizard does not itself
draw still survives an update. On any failure every mutation is rolled back: a freshly created asset
is deleted and its Addressables entry removed, an already-existing asset that was being edited has
its pre-call field values restored, and draft itself is restored to what the
caller handed in.
Declaration
public static AudioPlayerSettingsCreator.Result CreateFromDraft(UnityAudioPlayerSettings draft, AudioPlayerSettingsCreator.Input input)
Parameters
Returns
Full validation, re-checked at creation time so Create(Input) is safe to call
independently of a window's live validation.
Declaration
public static SerenityCreationValidationResult Validate(AudioPlayerSettingsCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|
Identity validation: the Id rules, and — once a folder is chosen — whether a different asset
already sits at the exact path this Id would create, so the Identity step blocks and names it before
the Summary ever plans that file.
Declaration
public static SerenityCreationValidationResult ValidateIdentity(AudioPlayerSettingsCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|