Beispiel #1
0
        public void Initialize(TypeSelectionFilter enable, Action <Type> onSelect)
        {
            _category = enable.Category;
            _onSelect = onSelect;
            TypeSelectionHolder.CheckInitialize(_category);

            // Indentation hack for search window
            _indentationIcon = new Texture2D(1, 1);
            _indentationIcon.SetPixel(0, 0, new Color(0, 0, 0, 0));
            _indentationIcon.Apply();
        }
Beispiel #2
0
        public List <SearchTreeEntry> CreateSearchTree(SearchWindowContext context)
        {
            var tree = new List <SearchTreeEntry>()
            {
                new SearchTreeGroupEntry(new GUIContent(_category), 0),
                new SearchTreeGroupEntry(new GUIContent("All"), 1),
            };

            foreach (var type in TypeSelectionHolder.GetTypeList(_category))
            {
                tree.Add(new SearchTreeEntry(new GUIContent(type.Name, _indentationIcon))
                {
                    userData = type,
                    level    = 2,
                });
            }

            return(tree);
        }