Class 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.
Inheritance
BatchAudioImportWindow<TItem, TInput, TResult, TAsset>
Assembly: Serenity.UnityAudioPlayer.Infrastructure.Editor.dll
Syntax
public abstract class BatchAudioImportWindow<TItem, TInput, TResult, TAsset> : BatchAudioImportWindowBase where TItem : BatchAudioImportItem, new() where TInput : BatchAudioImportInput<TItem>, new() where TResult : BatchAudioImportResult<TAsset>, new() where TAsset : ScriptableObject
Type Parameters
| Name |
Description |
| TItem |
The module's concrete row type.
|
| TInput |
The module's concrete batch-input type.
|
| TResult |
The module's concrete batch-result type.
|
| TAsset |
The module's concrete definition asset type.
|
Constructors
BatchAudioImportWindow()
Declaration
protected BatchAudioImportWindow()
Fields
_items
Declaration
protected readonly List<TItem> _items
Field Value
| Type |
Description |
| List<TItem> |
|
Properties
AudioExtensions
Declaration
protected abstract IReadOnlyList<string> AudioExtensions { get; }
Property Value
DefaultOutputFolder
Declaration
protected abstract string DefaultOutputFolder { get; }
Property Value
Labels
Declaration
protected abstract BatchAudioImportWindowLabels Labels { get; }
Property Value
Methods
ApplyNewItemDefaults(TItem)
Applies this window's own "new row" defaults to a freshly added item (e.g. sound effects'
Priority/Policy/CanBeReplaced fields, music's default artist).
Declaration
protected abstract void ApplyNewItemDefaults(TItem item)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
Create(TInput)
Declaration
protected abstract TResult Create(TInput input)
Parameters
| Type |
Name |
Description |
| TInput |
input |
|
Returns
Extra destination fields a module needs beyond the two folders (e.g. music's default
artist). No-op by default.
Declaration
protected virtual void DrawDestinationExtraFields()
A boxed section a module bolts on right after the sources section (e.g. sound effects'
"Common Defaults" box). A non-empty override owns its own leading/trailing spacing. No-op by default.
Declaration
protected virtual void DrawExtraOptionsSection()
DrawItemRow(int, TItem)
Draws the fields specific to one item's row, between the common Include/clip/remove header
and the common validation message.
Declaration
protected abstract void DrawItemRow(int index, TItem item)
Parameters
| Type |
Name |
Description |
| int |
index |
|
| TItem |
item |
|
FindDuplicateIds(IEnumerable<TItem>)
Declaration
protected abstract List<string> FindDuplicateIds(IEnumerable<TItem> items)
Parameters
Returns
ImportExternalAudioFile(string, string, out string)
Declaration
protected abstract AudioClip ImportExternalAudioFile(string osPath, string destinationFolder, out string error)
Parameters
Returns
| Type |
Description |
| AudioClip |
|
IsAudioFile(string)
Declaration
protected abstract bool IsAudioFile(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
ItemFromClip(AudioClip)
Declaration
protected abstract TItem ItemFromClip(AudioClip clip)
Parameters
| Type |
Name |
Description |
| AudioClip |
clip |
|
Returns
OnItemRemoved()
Extra cleanup once a single item is removed, beyond _items itself. No-op by
default.
Declaration
protected virtual void OnItemRemoved()
OnItemsCleared()
Extra cleanup once the item list is cleared, beyond _items itself (e.g.
music's advanced-foldout open state). No-op by default.
Declaration
protected virtual void OnItemsCleared()
Validate(TInput)
Declaration
protected abstract string Validate(TInput input)
Parameters
| Type |
Name |
Description |
| TInput |
input |
|
Returns
ValidateItem(TItem)
Declaration
protected abstract string ValidateItem(TItem item)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
Returns