private void Save() { EditorPrefsUtils.SaveColor(EditorPrefKeys.KEY_BACKGROUND_COLOR, searchResultBackground); EditorPrefsUtils.SaveColor(EditorPrefKeys.KEY_TEXT_COLOR, searchResultText); EditorStyles.Reset(); EditorApplication.RepaintHierarchyWindow(); }
private void OnEnable() { CreateWindowTabs(); EditorStyles.Initialize(); Texture2D windowIcon = Resources.Load <Texture2D>(string.Format("{0}/{1}", EditorStyles.ThemeFolder, EditorStyles.ICON_WINDOW)); this.titleContent = new GUIContent("Search", windowIcon); foreach (var kvp in m_Tabs) { kvp.Value.OnEnable(); } }
public void OnGUI() { EditorGUILayout.BeginHorizontal(); { EditorGUI.BeginChangeCheck(); SearchType = (TSearchType)(object)EditorGUILayout.EnumPopup((object)SearchType as Enum, GUILayout.Width(90f)); SearchTerm = EditorGUILayout.TextField(SearchTerm, GUILayout.ExpandWidth(true), GUILayout.MaxWidth(float.MaxValue)); if (EditorGUI.EndChangeCheck()) { OnStateUpdate(); } if (EditorStyles.GetIconButton(m_SearchIcon)) { if (m_OnSearch != null) { m_OnSearch(SearchType, SearchTerm); } } else if (EditorStyles.GetIconButton(m_ClearIcon)) { SearchTerm = string.Empty; GUI.FocusControl(null); OnStateUpdate(); if (m_OnClear != null) { m_OnClear(); } EditorApplication.RepaintHierarchyWindow(); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField("", GUILayout.MaxWidth(90f)); m_CaseSensitiveToggle.OnGUI(); m_MatchWholeWordToggle.OnGUI(); m_IncludeInactiveToggle.OnGUI(); } EditorGUILayout.EndHorizontal(); }