logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor

    Classes

    AudioMixerEffectLoopCreator

    Editor-only service that performs the actual AudioMixer modification for an "effect loop" group. Contains NO UI code — it takes a CreateAudioMixerEffectLoopInput and returns a CreateAudioMixerEffectLoopOutput, so it can be unit-driven or reused independently of the EditorWindow.

    What it builds. Under the chosen parent group it creates one new group whose effect chain is, in order:

    1. Receive — the routing destination (added at index 0).
    2. the user's selected effects, in the exact requested order.
    3. Attenuation — the group's wet/output volume stage. This is created automatically by Unity's CreateNewGroup flow and is intentionally LEFT as the final stage; a second Attenuation is never added.

    Routing usage (Receive side only). This tool builds only the RECEIVE side of a Send/Receive loop. It never modifies any group other than the new loop group and its parent link. To route audio into the loop, the user must afterwards select a source group (e.g. SFX or Voice) in the Audio Mixer window, add a Send effect to it, and point that Send at this loop group's Receive. The source Send's wet level controls how much signal is routed in; this loop's trailing Attenuation controls the overall returned wet level. Automatic Send wiring is deliberately out of scope (a possible future feature).

    Failure policy. Never throws to the caller: all errors (including internal-API reflection failures) are returned as a failed CreateAudioMixerEffectLoopOutput so the UI can show a clear message. Nothing fails silently. A failure that hits after the loop group was already created rolls that group back (see Create(CreateAudioMixerEffectLoopInput)), so a mid-run failure never leaves a half-built group behind.

    AudioMixerEffectLoopEffectEntry

    Serializable per-row model for CreateAudioMixerEffectLoopWindow's reorderable effect chain list.

    AudioMixerEffectLoopReflectionException

    Raised when the internal Unity AudioMixer API cannot be reached as expected — almost always because the (undocumented) internal API changed in a Unity version. The message always names the running Unity version so maintainers can pinpoint the break.

    AudioMixerEffectLoopSyncService

    Editor-only engine that makes the AudioMixer match an effect-loop DEFINITION (the source of truth): for every Source group it ensures a Send into the loop's Receive exists and its level is exposed as {Source}_{Loop}_Send — writing the resolved exposed-parameter names back onto the definition. The loop's own output level is left as a static mixer setting (not exposed). Idempotent/additive: it never removes anything and skips what already exists. Reads mixer structure via YAML (UnityYamlUtils), writes via Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopReflectionAdapter. Never throws to the caller.

    AudioMixerEffectLoopSyncService.SyncReport

    Per-definition sync outcome.

    AudioMixerYamlReader

    Editor-only reader for AudioMixer (.mixer) assets via their YAML representation. Keeps all knowledge of the AudioMixer's serialized shape (AudioMixerController / AudioMixerGroupController, m_Children, m_Effects, m_ExposedParameters, m_Volume, ...) inside the SoundMixer module instead of the generic UnityYamlUtils. Reads only; never mutates.

    A Unity YAML asset is a stream of object documents (--- !u!<tag> &<fileID>, then <TypeName>: { fields }); references between objects are mappings {fileID: X}. Unity exposes no public API to read this structure, so it is parsed directly.

    CreateAudioMixerEffectLoopWindow

    Editor tool (Tools ▸ Serenity ▸ Create ▸ Audio ▸ Create Audio Mixer Effect Loop) for building an AudioMixer "effect loop" group: a child group whose chain is Receive -> user effects (in order) -> Attenuation, ready to be used as a Send/Receive routing destination.

    Separation of concerns. This window only collects input and renders results, across a stepped wizard whose scaffolding — the header and breadcrumb, the body scroll, the footer and its error gate — comes from Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1; this window declares only its own step table and what the primary action does. All AudioMixer modification lives in AudioMixerEffectLoopCreator, and every internal Unity API call is isolated in Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopReflectionAdapter. The loop's own fields, the effect-chain list editor, the source-group picker and the Summary are extracted collaborators — Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopDraft, Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopWizardEffectChainGui, Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopWizardSourceGroupsStepGui and Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopWizardSummaryStepGui — under the file-size ratchet.

    How to use the generated loop (manual Send wiring). This tool creates only the RECEIVE side. After creating, e.g., "EchoLoop":

    1. Open the Audio Mixer window and select a source group (e.g. SFX or Voice).
    2. Add a Send effect to that source group.
    3. Set the Send's target to this loop group's Receive effect.
    4. Use the source Send's wet level to control how much is routed in, and this loop's trailing Attenuation to control the overall returned wet output.

    The tool intentionally does NOT add or configure Sends on other groups, so it never mutates any group besides the new loop group and its parent relationship.

    Managing an existing loop. A Loop Id another definition already owns is resolved on the Loop step through Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopIdentity: when the run can update that definition, every field is seeded from it and Create updates it in place without a new group; when it cannot, the Loop step and the Summary block, naming the definition, before anything is written.

    SoundMixerEffectLoopActionScriptGenerator

    Editor-only generator that emits an Enable + Disable EventDispatcher action/signal pair for each source group of an effect loop, so the loop can be toggled from a menu without hand-writing scripts. It reuses the SAME generation as the manual "Action Script" tool (Serenity.UnityGlobal.Infrastructure.Editor.EventDispatcherActionScriptGenerator.CreateActionScript(System.String,System.String,System.String,System.String[],System.String[],System.Boolean)), injecting an Execute body that resolves ISoundMixerService and calls ApplyEffectLoop / ClearEffectLoop for that (loop id, source group). Idempotent: existing files are skipped. Never throws to the caller.

    SoundMixerEffectLoopActionScriptGenerator.Result

    Outcome of a generation run.

    SoundMixerEffectLoopBinder

    Editor-only helper that registers an effect-loop definition into the project's UnitySoundMixerSettings so the runtime service can resolve it by id (the service builds its lookup strictly from settings.EffectLoops). Idempotent: it adds the definition only when missing. The target settings asset is the one project-owned settings asset that references the definition's own mixer — never settings made for another mixer, and never settings the package ships, which the next package update overwrites. DescribeSettingsProblemFor(AudioMixer) states the same resolution's failure before a run, so a wizard can block on it instead of failing after it started. Never throws to the caller.

    SoundMixerEffectLoopBinder.RegistrationReport

    Outcome of an EnsureRegistered(UnitySoundMixerEffectLoopDefinition, SerenityAssetCreationTransaction) call.

    SyncSoundMixerEffectLoopsWindow

    Editor window (Tools ▸ Serenity ▸ Create ▸ Audio ▸ Sync Effect Loops) that makes the AudioMixer match the project's effect-loop definitions. The definition is the source of truth: add a source group to a definition's Sources, press Sync, and the mixer wiring (Send + exposed parameters) appears — idempotent and additive. Its own list of found definitions IS the affected-scope preview, so it does not subclass Serenity.Global.Infrastructure.Editor.SerenityActionToolWindow (one execute button per definition, plus a bulk one, not the single-action shape that base class assumes); it still leans on the same shared chrome and log.

    UnitySoundMixerEffectLoopDefinitionFactory

    Editor-only service that creates and persists a UnitySoundMixerEffectLoopDefinition asset for a freshly created effect loop. Contains NO UI: it takes a CreateSoundMixerEffectLoopDefinitionInput and returns a CreateSoundMixerEffectLoopDefinitionOutput, mirroring the separation used by AudioMixerEffectLoopCreator for the mixer side.

    Validates the request, blocks duplicate loop ids (scanning existing definition assets), writes the asset to a collision-free path, and never throws to the caller. UpdateExisting(UnitySoundMixerEffectLoopDefinition, CreateSoundMixerEffectLoopDefinitionInput) is the update-in-place counterpart the wizard uses when the Loop Id names a definition that already exists.

    Enums

    CreateAudioMixerEffectLoopWindow.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