public bool DrawInputMode(string fallback = "Search", string splitBy = " ", string endSymbol = "+") { EditorGUILayout.BeginHorizontal(); var color = EditorStyles.textField.normal.textColor.SetAlpha(0.5f); var baseStyle = EditorStyles.textField.Alignment("MiddleCenter"); var symbolStyle = baseStyle.FixedWidth(24).FontSize(16).TextColor(color); var inputStyle = baseStyle.FontStyle("BoldAndItalic"); EditorUI.SetLayout(-1, 30); if ("∗".ToLabel().DrawButton(symbolStyle.ContentOffset(1, 0).Overflow(0, 3, 0, 0), false)) { var menu = new EditorMenu(); Action clear = () => this.queue = ""; menu.Add("Search", this.inputMode == 0, (() => { this.inputMode = 0; }) + clear); //menu.Add("Split",this.inputMode==1,(()=>{this.inputMode=1;})+clear); menu.Draw(); } var filter = this.inputTerms.Join(splitBy).Replace("~", " ").Draw(null, inputStyle); var inputChanged = EditorUI.lastChanged; EditorUI.lastChanged = false; endSymbol.ToLabel().DrawButton(symbolStyle.ContentOffset(-2, 0).Overflow(3, 0, 0, 0), false); EditorUI.SetLayout(-1, 0); EditorGUILayout.EndHorizontal(); bool open = false; var output = new StringBuilder(); foreach (var symbol in filter) { if (symbol == '[') { open = true; } if (symbol == ']') { open = false; } output.Append(symbol == ' ' && open ? '~' : symbol); } this.queue = this.queue ?? (output.ToString().Trim().IsEmpty() ? fallback : output.ToString()); this.queueSplit = splitBy; Utility.SetPref <string>("GUISkin-" + fallback + "-" + this.hash, this.inputTerms.Join(splitBy)); GUI.changed = false; return(inputChanged); }