public static void UpArrow(SearchSuggestion[] suggestions) { if (!suggestions[0].isEnabled) { return; } if (currentlySelected == 0) { ResetSelection(); } else { currentlySelected--; selected.Deselect(); selected = suggestions[currentlySelected.Value]; selected.Select(); } }
public static void DownArrow(SearchSuggestion[] suggestions) { if (!suggestions[0].isEnabled) { return; } if (currentlySelected == null) { currentlySelected = 0; } else if (currentlySelected < 4 && suggestions[currentlySelected.Value + 1].isEnabled) { currentlySelected++; } if (selected != suggestions[currentlySelected.Value]) { if (selected != null) { selected.Deselect(); } selected = suggestions[currentlySelected.Value]; selected.Select(); } }