public override void OnGUI(Rect rect) { search_string = EditorGUILayout.TextField(search_name + ": ", search_string); SoundBank bank = AssetDatabase.LoadAssetAtPath <SoundBank>("Assets/SFX/SoundBank/SoundBank.asset"); string[] codenames = bank.GetAllSFXClipCodenames().ToArray(); string[] names = bank.GetAllSFXClipNames().ToArray(); for (int i = 0; i < codenames.Length; i++) { if (search_string != "" && !codenames[i].Contains(search_string) && !names[i].Contains(search_string)) { continue; } if (GUILayout.Button(names[i] + " : " + codenames[i])) { on_click(codenames[i]); editorWindow.Close(); } } }