Exemplo n.º 1
0
        private SearchablePopup(string[] names, int currentIndex, Action <int, string> onSelectionMade)
        {
            list = new FilteredList(names);
            this.currentIndex    = currentIndex;
            this.onSelectionMade = onSelectionMade;

            hoverIndex    = currentIndex;
            scrollToIndex = currentIndex;
            scrollOffset  = GetWindowSize().y - ROW_HEIGHT * 2;
            searchField   = new SearchFieldDrawer(list.fitter, null, 0);
        }
Exemplo n.º 2
0
            public ToolBarSearchField(GUIContent content, Action <string> onValueChange, string value, int width = 100) : base(content, width)
            {
                this.onValueChange = onValueChange;

                s = new SearchFieldDrawer()
                {
                    value = value,
                };
                s.onValueChange += (str) => {
                    if (this.onValueChange != null)
                    {
                        this.onValueChange(str);
                    }
                    value = str;
                };
            }