logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityAudioPlayerClipDefinitionEditor

    Unity Editor custom inspector for UnityAudioPlayerClipDefinition ScriptableObject.
    Provides specialized GUI for configuring individual audio clip definitions including Unity AudioClip asset references and addressable asset paths. Features validation for clip assignments and path configurations with integrated editor tooling for audio asset management workflows.
    The stored AudioClipPath is kept in sync:

    • When an AudioClip is assigned or removed.
    • When the author presses the update button the inspector shows for a stale path (the clip moved or an Addressables address changed) — drawing the inspector, moving the clip or changing an address never writes the asset. The Health Check lists the same drift with its own fix, which runs the same Serenity.AudioPlayer.Infrastructure.Settings.Editor.UnityAudioPlayerClipPathSync.
    Inheritance
    object
    UnityAudioPlayerClipDefinitionEditor
    Namespace: Serenity.AudioPlayer.Infrastructure.Settings.Editor
    Assembly: Serenity.UnityAudioPlayer.Infrastructure.Editor.dll
    Syntax
    public class UnityAudioPlayerClipDefinitionEditor : FoundationEditor<UnityAudioPlayerClipDefinition>

    Constructors

    UnityAudioPlayerClipDefinitionEditor()

    Declaration
    public UnityAudioPlayerClipDefinitionEditor()

    Methods

    DrawSerializedFields()

    Suppresses the base auto-drawing of serialized fields; this editor renders every field explicitly so it can keep AudioClipPath in sync and validate priority input.

    Declaration
    protected override void DrawSerializedFields()

    OnInspectorGUI()

    Renders the custom inspector GUI for UnityAudioPlayerClipDefinition ScriptableObject.
    A stored AudioClipPath that drifted from the clip (e.g. an Addressables address edit) is reported with a button that resyncs it, rather than rewritten because the asset was drawn.

    Declaration
    public override void OnInspectorGUI()

    RenderAudioClipHandler(UnityAudioPlayerClipDefinition)

    Renders the audio clip assignment field with validation and path synchronisation.
    Uses Serenity.AudioPlayer.Infrastructure.Settings.Editor.UnityAudioPlayerClipPathSync.ExpectedPath(Serenity.AudioPlayer.Infrastructure.Settings.UnityAudioPlayerClipDefinition) to derive the correct Addressables address or AssetDatabase path whenever the clip reference changes.

    Declaration
    public void RenderAudioClipHandler(UnityAudioPlayerClipDefinition settings)
    Parameters
    Type Name Description
    UnityAudioPlayerClipDefinition settings

    Audio clip definition settings to modify.

    RenderCanBeReplacedHandler(UnityAudioPlayerClipDefinition)

    Renders the toggle controlling whether a sound started from this clip may be reassigned to make room for a higher-priority sound.

    Declaration
    public void RenderCanBeReplacedHandler(UnityAudioPlayerClipDefinition settings)
    Parameters
    Type Name Description
    UnityAudioPlayerClipDefinition settings

    Audio clip definition to modify.

    RenderPriorityHandler(UnityAudioPlayerClipDefinition)

    Renders the Serenity priority field. Higher value = more important (the opposite of Unity's AudioSource.priority). Negative values are clamped to 0.

    Declaration
    public void RenderPriorityHandler(UnityAudioPlayerClipDefinition settings)
    Parameters
    Type Name Description
    UnityAudioPlayerClipDefinition settings

    Audio clip definition to modify.

    RenderPriorityPolicyHandler(UnityAudioPlayerClipDefinition)

    Renders the priority policy dropdown that decides whether this clip may take over a busy AudioSource when the pool is full.

    Declaration
    public void RenderPriorityPolicyHandler(UnityAudioPlayerClipDefinition settings)
    Parameters
    Type Name Description
    UnityAudioPlayerClipDefinition settings

    Audio clip definition to modify.

    In this article
    © 2026 Serenity. All Rights Reserved