private void DrawAssetMappingList() { GUILayout.BeginVertical(GUI.skin.box); GUILayout.BeginHorizontal(); GUILayout.Label("Audio Asset Mappings"); if (GUILayout.Button("Nuke")) { ScriptableObject.CreateInstance <ConfirmActionPopup>() .SetQuestion("You're about to nuke all elements from this library, are you sure?"). OnConfirm += DeleteAllElements; } if (GUILayout.Button("Remove")) { RemoveSelectedElement(); } if (GUILayout.Button("Add")) { EditorWindow.CreateInstance <CreateAudioAssetPopup>() .SetFolder("Assets/Audio/AudioAssets/") .OnCreated += AddElement; } GUILayout.EndHorizontal(); _SelectableAudioAssetList.DoList(_MappingList.arraySize, _ScrollVector); GUILayout.EndVertical(); }
public void DrawClipList() { GUILayout.BeginVertical(GUI.skin.box); GUILayout.BeginHorizontal(); GUILayout.Label("Sound clips"); if (GUILayout.Button("Nuke")) { EditorWindow.CreateInstance <ConfirmActionPopup>() .SetQuestion("You're about to remove all soundclips. Are you sure?") .OnConfirm += RemoveAllElements; } if (GUILayout.Button("Remove")) { RemoveElement(); } if (GUILayout.Button("Add")) { AddElement(); } GUILayout.EndHorizontal(); _SelectableList.DoList(_ClipList.arraySize, _ScrollVector); GUILayout.EndVertical(); AudioClip[] audioclips = EditorScriptUtil.FilteredDrop <AudioClip>(); if (audioclips != null) { foreach (AudioClip clip in audioclips) { AddClip(clip); } } }
public void DoList() { FetchResources(); GUILayout.BeginHorizontal(); GUILayout.Label($"{nameof(AudioLibraryList)}"); if (GUILayout.Button("Create New Library")) { EditorWindow.CreateInstance <CreateAudioLibraryAssetPopup>() .SetFolder("Assets/Audio/Resources/") .OnCreated += OnNewElementcreated; } if (GUILayout.Button("Delete")) { RemoveSelectedElement(); } GUILayout.EndHorizontal(); _ScrollPosition = EditorGUILayout.BeginScrollView(_ScrollPosition); _SelectionList.DoList(_AssetLabels.Length, _ScrollPosition); EditorGUILayout.EndScrollView(); }