Exemplo n.º 1
0
        protected virtual void OnGUI()
        {
            this.HandleKeyboard();

            GUI.Label(new Rect(0.0f, 0.0f, this.position.width, this.position.height), GUIContent.none, _style.background);
            GUILayout.Space(7f);
            EditorGUI.FocusTextInControl(CNTRL_TYPESEARCH);

            //first draw search area and update search if needed
            var rect = GUILayoutUtility.GetRect(10f, 20f);

            rect.x     += 8f;
            rect.width -= 16f;

            GUI.SetNextControlName(CNTRL_TYPESEARCH);
            _search = SPEditorGUI.SearchField(rect, _search);
            if (_search != _lastSearch)
            {
                this.RebuildSearch();
            }
            else if (_searchIsDirty)
            {
                this.RebuildSearch();
            }


            //next draw type header (display the name of the base type)
            rect = GUILayoutUtility.GetRect(10f, 25f);
            EditorGUI.LabelField(rect, _header, _style.header);

            //lastly list found types
            this.DrawList();
        }