├── .github └── FUNDING.yml ├── .gitignore ├── ButtonSoundsEditor ├── Assets │ ├── Plugins.meta │ └── Plugins │ │ ├── ButtonSoundsEditor.meta │ │ └── ButtonSoundsEditor │ │ ├── ButtonClickSound.cs │ │ ├── ButtonClickSound.cs.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── ButtonSoundsEditor.cs │ │ └── ButtonSoundsEditor.cs.meta │ │ ├── Examples.meta │ │ └── Examples │ │ ├── C_1.png │ │ ├── C_1.png.meta │ │ ├── PUSAB__.otf │ │ ├── PUSAB__.otf.meta │ │ ├── TestScene.unity │ │ ├── TestScene.unity.meta │ │ ├── b_off.png │ │ ├── b_off.png.meta │ │ ├── b_on.png │ │ ├── b_on.png.meta │ │ ├── button-control-gray.png │ │ ├── button-control-gray.png.meta │ │ ├── button-settings-gray.png │ │ ├── button-settings-gray.png.meta │ │ ├── button-shop-blue.png │ │ ├── button-shop-blue.png.meta │ │ ├── button-tweet-gray.png │ │ ├── button-tweet-gray.png.meta │ │ ├── button_1.png │ │ ├── button_1.png.meta │ │ ├── click1.wav │ │ ├── click1.wav.meta │ │ ├── click2.wav │ │ ├── click2.wav.meta │ │ ├── gun1.png │ │ ├── gun1.png.meta │ │ ├── money.mp3 │ │ ├── money.mp3.meta │ │ ├── splash2.png │ │ └── splash2.png.meta └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ └── UnityConnectSettings.asset ├── LICENSE.txt └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: paypal.me/nubick 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ButtonSoundsEditor/Library/ 2 | ButtonSoundsEditor/Temp/ 3 | ButtonSoundsEditor/obj/ 4 | *.suo 5 | *.csproj 6 | *.sln 7 | *.userprefs -------------------------------------------------------------------------------- /ButtonSoundsEditor/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cab12cef9f35d4d428213a74b9f4e0ac 3 | folderAsset: yes 4 | timeCreated: 1490431971 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ButtonSoundsEditor/Assets/Plugins/ButtonSoundsEditor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f00547c446ae47ffa4e26c5ff528d1a 3 | folderAsset: yes 4 | timeCreated: 1469263276 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ButtonSoundsEditor/Assets/Plugins/ButtonSoundsEditor/ButtonClickSound.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | 4 | namespace Assets.Plugins.ButtonSoundsEditor 5 | { 6 | public class ButtonClickSound : MonoBehaviour, IPointerClickHandler 7 | { 8 | public AudioSource AudioSource; 9 | public AudioClip ClickSound; 10 | 11 | public void OnPointerClick(PointerEventData eventData) 12 | { 13 | PlayClickSound(); 14 | } 15 | 16 | private void PlayClickSound() 17 | { 18 | AudioSource.PlayOneShot(ClickSound); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /ButtonSoundsEditor/Assets/Plugins/ButtonSoundsEditor/ButtonClickSound.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db7d01bc933f27143a65ab22c43e8d6c 3 | timeCreated: 1456501687 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ButtonSoundsEditor/Assets/Plugins/ButtonSoundsEditor/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42092d511f68b934dae6cb3306aa47b1 3 | folderAsset: yes 4 | timeCreated: 1456501806 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ButtonSoundsEditor/Assets/Plugins/ButtonSoundsEditor/Editor/ButtonSoundsEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEditor; 5 | using UnityEditor.SceneManagement; 6 | using UnityEngine; 7 | using UnityEngine.EventSystems; 8 | using UnityEngine.SceneManagement; 9 | using UnityEngine.UI; 10 | 11 | namespace Assets.Plugins.ButtonSoundsEditor.Editor 12 | { 13 | public class ButtonSoundsEditor : EditorWindow, IComparer 14 | { 15 | private const string AllClickSoundFilter = "All"; 16 | private const string NotAssignedClickSoundFilter = "Not Assigned"; 17 | 18 | private Dictionary> _candidates; 19 | private GameObject _selectedCandidate; 20 | private CandidatesTypeFilter _candidatesTypeFilter; 21 | private string _selectedClickSoundFilter = AllClickSoundFilter; 22 | 23 | private AudioSource _audioSource; 24 | private AudioClip _clickSound; 25 | private Vector2 _scrollPosition; 26 | 27 | private List All { get { return _candidates[CandidatesTypeFilter.All]; } } 28 | 29 | #region Initialization 30 | 31 | public ButtonSoundsEditor() 32 | { 33 | _candidates = new Dictionary>(); 34 | _candidates.Add(CandidatesTypeFilter.All, new List()); 35 | _candidates.Add(CandidatesTypeFilter.Buttons, new List()); 36 | _candidates.Add(CandidatesTypeFilter.Toggles, new List()); 37 | _candidates.Add(CandidatesTypeFilter.EventTriggers, new List()); 38 | } 39 | 40 | [MenuItem("Window/Utils/Button sounds editor")] 41 | public static void OpenEditor() 42 | { 43 | ButtonSoundsEditor window = GetWindow(); 44 | window.titleContent = new GUIContent("Button sounds editor"); 45 | window.Initialize(); 46 | window.Show(); 47 | } 48 | 49 | private void Initialize() 50 | { 51 | RefreshCandidates(); 52 | ButtonClickSound[] clickSounds = GetAllSoundComponents(All); 53 | _audioSource = GetFirstAudioSource(clickSounds); 54 | _clickSound = GetFirstClickSound(clickSounds); 55 | } 56 | 57 | private ButtonClickSound[] GetAllSoundComponents(List candidates) 58 | { 59 | return candidates.Select(_ => _.GetComponent()).Where(_ => _ != null).ToArray(); 60 | } 61 | 62 | private AudioSource GetFirstAudioSource(ButtonClickSound[] clickSounds) 63 | { 64 | ButtonClickSound buttonClickSound = clickSounds.FirstOrDefault(_ => _.AudioSource != null); 65 | return buttonClickSound == null ? null : buttonClickSound.AudioSource; 66 | } 67 | 68 | private AudioClip GetFirstClickSound(ButtonClickSound[] clickSounds) 69 | { 70 | ButtonClickSound buttonClickSound = clickSounds.FirstOrDefault(_ => _.ClickSound != null); 71 | return buttonClickSound == null ? null : buttonClickSound.ClickSound; 72 | } 73 | 74 | #endregion 75 | 76 | private void RefreshCandidates() 77 | { 78 | _candidates.Values.ToList().ForEach(_ => _.Clear()); 79 | 80 | var buttons = Resources.FindObjectsOfTypeAll