public static Type SearchBar(params Type[] types) { if (s_NoneButtonContent == null) { s_NoneButtonContent = EditorGUIUtility.IconContent("sv_icon_none"); s_NoneButtonContent.text = "None"; } if (s_FocusType != null && (s_HierarchyWindow == null || s_HierarchyWindow.m_SearchFilter != "t:" + s_FocusType.Name)) { s_FocusType = null; } GUILayout.Label("Scene Filter:"); EditorGUILayout.BeginHorizontal(); { GUIContent label = EditorGUIUtility.TempContent( "All", AssetPreview.GetMiniTypeThumbnail(typeof(GameObject))); if (TypeButton(label, s_FocusType == null, styles.typeButton)) { SceneModeUtility.SearchForType(null); } } for (int i = 0; i < types.Length; i++) { Type type = types[i]; Texture2D icon = null; if (type == typeof(Renderer)) { icon = EditorGUIUtility.IconContent("MeshRenderer Icon").image as Texture2D; } else if (type == typeof(Terrain)) { icon = EditorGUIUtility.IconContent("Terrain Icon").image as Texture2D; } else { icon = AssetPreview.GetMiniTypeThumbnail(type); } string name = ObjectNames.NicifyVariableName(type.Name) + "s"; GUIContent label = EditorGUIUtility.TempContent(name, icon); if (TypeButton(label, type == s_FocusType, styles.typeButton)) { SceneModeUtility.SearchForType(type); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); return(s_FocusType); }