logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.AudioPlayer.Infrastructure.Settings.Editor.Builder

    Classes

    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.

    AudioPlayerSettingsCreator.Input

    Everything needed to create or update one channel's settings asset.

    AudioPlayerSettingsCreator.Result

    Outcome of a Create(Input) call.

    BatchAudioAssetImportEngine<TItem, TInput, TResult, TAsset>

    Template-method engine shared by every "batch-import audio files into a ScriptableObject definition" wizard (sound effects, music tracks): file-type inference, id/asset-name suggestion, duplicate detection, folder-scoped validation, a UnityEditor.AssetDatabase.StartAssetEditing-batched creation with rollback on failure, Addressables registration, and external-file import. A concrete subclass supplies only what genuinely differs between modules: how one item becomes a definition asset (BuildAsset(TItem)), the Addressables module label, the empty-input fallbacks, any extra per-item validation (e.g. music's loop-region rules), and any extra defaults an item gets when built from an already-imported clip (e.g. music's suggested title).

    BatchAudioImportWindow<TItem, TInput, TResult, TAsset>

    Template-method window completing BatchAudioAssetImportEngine<TItem, TInput, TResult, TAsset>'s template pair: the engine owns every batch-import RULE (inference, validation, creation, Addressables registration); this owns the IMGUI scaffolding every batch-import wizard hand-rolled around it — destination folders, the drop zone, the Add File/Add Folder/Clear toolbar, the per-item list frame, the summary/create footer and the created-results panel. A concrete subclass (one per module — see BatchSoundEffectImportWindow, BatchMusicTrackImportWindow) supplies only what genuinely differs: its own BatchAudioImportWindowLabels copy, the per-item row fields (DrawItemRow(int, TItem)), the defaults a freshly dropped item gets (ApplyNewItemDefaults(TItem)), any section the module bolts on beyond the shared ones (DrawDestinationExtraFields(), DrawExtraOptionsSection()), any per-run cleanup beyond clearing the item list (OnItemsCleared(), OnItemRemoved()), and — because each module's engine instance is private inside its own static importer class (BatchSoundEffectImporter.ImportEngine, BatchMusicTrackImporter.ImportEngine) — a set of one-line passthroughs to that importer's own static API.

    BatchSoundEffectImportWindow

    Wizard window (Tools ▸ Serenity ▸ Create ▸ Audio ▸ Batch Import Sound Effects) for importing and configuring many sound effects at once. The user drops or adds audio files, reviews/edits the per-item rows, applies common defaults, then creates one UnityAudioPlayerClipDefinition per effect. All logic lives in BatchSoundEffectImporter; the shared IMGUI scaffolding (destination folders, drop zone, item list, summary/create) lives in BatchAudioImportWindow<TItem, TInput, TResult, TAsset>; this window supplies only what is specific to sound effects: its own copy, the Priority/PriorityPolicy/CanBeReplaced row fields and their "Common Defaults" section.

    BatchSoundEffectImporter

    Builds UnityAudioPlayerClipDefinition assets in batch from validated wizard input, with rollback on failure. Everything shared with the music-track importer (inference, duplicate detection, validation skeleton, batched creation with rollback, Addressables registration, external file import) lives in BatchAudioAssetImportEngine<TItem, TInput, TResult, TAsset>; this class supplies only the sound-effect-specific parts via BatchSoundEffectImporter.ImportEngine. The BatchSoundEffectImportWindow only collects input and renders results.

    BatchSoundEffectImporter.Input

    Everything needed to create a batch of clip definitions.

    BatchSoundEffectImporter.Item

    One sound effect to import: its source, resolved clip and per-item parameters.

    BatchSoundEffectImporter.Result

    Outcome of a Create(Input) call.

    CreateAudioPlayerSettingsWindow

    Step-by-step window for creating (or updating) one UnityAudioPlayerSettings asset — a Serenity audio channel. The stepped-wizard scaffolding — the header and breadcrumb, the body scroll, the footer and its error gate, and the select-and-ping a finished run ends with — comes from Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1; this window declares only its own step table and what the primary action does. The window only collects input and renders results, AudioPlayerSettingsCreator does the actual validation and generation work.

    Unlike GameSave's single project-wide asset, a project authors many channels (one per AudioPlayerType), so the Done step offers "Create another audio player" instead of ending the flow — the multi-instance payoff CreateScoreSettingsWindow's Done step models. That panel is also the one step here that draws no footer: its descriptor sets Serenity.Global.Infrastructure.Editor.WizardStepDescriptor`1.ShowsFooter to false, the flag standing in for the early return this window's own hand-rolled footer used to open with.

    Structs

    BatchAudioImportWindowLabels

    The label copy every section of BatchAudioImportWindow<TItem, TInput, TResult, TAsset>'s shared OnGUI needs, in one place per concrete window so the differences between modules read at a glance instead of scattered across a dozen overrides. A top-level, non-generic type on purpose: it carries no dependency on TItem/TInput/TResult/TAsset, so nesting it inside the generic window base would only have produced one distinct closed type per module for no reason — and would have forced every caller and test back onto MakeGenericType just to reach it.

    Enums

    CreateAudioPlayerSettingsWindow.WizardStep

    Public rather than private because C# requires a class's base type to be at least as accessible as the class itself, and this enum is that base type's argument.

    In this article
    © 2026 Serenity. All Rights Reserved