예제 #1
0
        private void Save()
        {
            EditorPrefsUtils.SaveColor(EditorPrefKeys.KEY_BACKGROUND_COLOR, searchResultBackground);
            EditorPrefsUtils.SaveColor(EditorPrefKeys.KEY_TEXT_COLOR, searchResultText);

            EditorStyles.Reset();
            EditorApplication.RepaintHierarchyWindow();
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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();
        }