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 automatically:
- When an AudioClip is assigned or removed.
- On every inspector redraw (catches Addressables address changes).
- When the AudioClip asset is moved (via Serenity.AudioPlayer.Infrastructure.Settings.Editor.UnityAudioPlayerClipDefinitionPostprocessor).
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.
Also synchronises AudioClipPath on every redraw so that external changes
(e.g. Addressables address edits) are reflected without requiring manual reassignment.
Declaration
public override void OnInspectorGUI()
RenderAudioClipHandler(UnityAudioPlayerClipDefinition)
Renders the audio clip assignment field with validation and path synchronisation.
Uses Serenity.Global.Infrastructure.Editor.Utils.UnityEditorUtils.AssetUtils.ResolveAudioClipPath(UnityEngine.AudioClip) 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. |