logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

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

    Inheritance
    object
    UnitySoundMixerEffectLoopDefinitionFactory
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor
    Assembly: Serenity.UnitySoundMixer.Infrastructure.Editor.dll
    Syntax
    public static class UnitySoundMixerEffectLoopDefinitionFactory

    Fields

    DefaultOutputFolder

    Folder a brand-new effect loop definition asset is created under when the caller names none.

    Declaration
    public const string DefaultOutputFolder = "Assets/Game/Media/Audio/EffectLoops"
    Field Value
    Type Description
    string

    LoopIdRegex

    Allowed characters for a loop id/key (a routing key: letters, digits, '_' and '-', no spaces).

    Declaration
    public static readonly Regex LoopIdRegex
    Field Value
    Type Description
    Regex

    Methods

    Create(CreateSoundMixerEffectLoopDefinitionInput, ICollection<string>)

    Creates the definition asset described by input, creating its destination folder first when it does not exist yet.

    Declaration
    public static CreateSoundMixerEffectLoopDefinitionOutput Create(CreateSoundMixerEffectLoopDefinitionInput input, ICollection<string> createdFolderPaths = null)
    Parameters
    Type Name Description
    CreateSoundMixerEffectLoopDefinitionInput input

    What to create and where.

    ICollection<string> createdFolderPaths

    Receives every folder this call creates, so a caller's rollback can remove them again — pass Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction.FolderTracking.

    Returns
    Type Description
    CreateSoundMixerEffectLoopDefinitionOutput

    FindExistingDefinitionPathById(string)

    Scans all existing definition assets and returns the path of one whose Id matches loopId, or null if none. Public (not private) so CreateAudioMixerEffectLoopWindow can resolve the loop its Loop Id names the moment it is typed — to update it in place, or to block the Loop step when it cannot — instead of only after Create(CreateSoundMixerEffectLoopDefinitionInput, ICollection<string>) refuses it at commit time.

    Declaration
    public static string FindExistingDefinitionPathById(string loopId)
    Parameters
    Type Name Description
    string loopId
    Returns
    Type Description
    string

    NextFreeLoopId(string)

    The first Loop Id at or after desiredLoopId — the Id itself, then the Id with an underscored number — that no definition in the project owns: what a fresh run of the wizard starts from, so "Create Another" does not open on the loop it just created.

    Declaration
    public static string NextFreeLoopId(string desiredLoopId)
    Parameters
    Type Name Description
    string desiredLoopId
    Returns
    Type Description
    string

    UpdateExisting(UnitySoundMixerEffectLoopDefinition, CreateSoundMixerEffectLoopDefinitionInput)

    Writes input's editable fields — display name, description, default wet and, when the input carries routes, the sources — onto existing in place. The loop group, mixer, Id and effect list stay as they are: they describe a group already on the mixer, which an update does not rebuild. A source still routed keeps the exposed parameter names a sync already wrote onto it; one no longer routed is dropped with a warning, since its Send stays on the mixer. The caller captures existing for rollback BEFORE calling this. Never throws to the caller.

    Declaration
    public static CreateSoundMixerEffectLoopDefinitionOutput UpdateExisting(UnitySoundMixerEffectLoopDefinition existing, CreateSoundMixerEffectLoopDefinitionInput input)
    Parameters
    Type Name Description
    UnitySoundMixerEffectLoopDefinition existing
    CreateSoundMixerEffectLoopDefinitionInput input
    Returns
    Type Description
    CreateSoundMixerEffectLoopDefinitionOutput

    Validate(CreateSoundMixerEffectLoopDefinitionInput)

    Validates a request. Returns the first failing rule's message, or null when valid. Reusable by the UI to gate the Create button.

    Declaration
    public static string Validate(CreateSoundMixerEffectLoopDefinitionInput input)
    Parameters
    Type Name Description
    CreateSoundMixerEffectLoopDefinitionInput input
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved