private void RegisterCallbacks() { duplicateButton.onClick.AddListener(() => OnDuplicate?.Invoke()); addButton.onClick.AddListener(() => OnAdd?.Invoke()); removeButton.onClick.AddListener(() => OnRemove?.Invoke()); moveUpButton.onClick.AddListener(() => OnMoveUp?.Invoke()); moveDownButton.onClick.AddListener(() => OnMoveDown?.Invoke()); RegisterSegmentedControlCallbacks(eventTypeSelect); RegisterSegmentedControlCallbacks(qualRankSelect); RegisterSegmentedControlCallbacks(inLimitSelect); RegisterSegmentedControlCallbacks(preQualLimitSelect); RegisterSegmentedControlCallbacks(preQualRankSelect); RegisterSegmentedControlCallbacks(ordRankSelect); RegisterSegmentedControlCallbacks(hillSurfaceSelect); presetsDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke()); hillsDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke()); hillsDropdown.onValueChanged.AddListener(arg => ShowInfo()); inLimitInput.onEndEdit.AddListener(arg => OnCurrentEventChanged?.Invoke()); qualRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke()); preQualLimitInput.onEndEdit.AddListener(arg => OnCurrentEventChanged?.Invoke()); preQualRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke()); ordRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke()); hillsSearch.OnValueChanged += data => { OnCurrentEventChanged?.Invoke(); }; }
private void Start() { AddButton.onClick.AddListener(() => OnAdd?.Invoke(Index)); RemoveButton.onClick.AddListener(() => OnRemove?.Invoke(Index)); MoveDownButton.onClick.AddListener(() => OnMoveDown?.Invoke(Index)); MoveUpButton.onClick.AddListener(() => OnMoveUp?.Invoke(Index)); TypeDropdown.onValueChanged.AddListener(FireTypeChangedEvent); }
IEnumerator ListenToInput() { while (true) { yield return(null); if (input.GetKeyDown(settings.ToggleConsole) && !anyKeyLastFrame) { OnToggleVisibility?.Invoke(); } anyKeyLastFrame = input.AnyKey; if (!console.Enabled) { continue; } if (input.GetKeyDown(settings.Submit) || input.GetKeyDown(settings.Submit2)) { OnSubmit(); } else if (input.GetKeyDown(settings.HintUp)) { OnMoveUp?.Invoke(); } else if (input.GetKeyDown(settings.HintDown)) { OnMoveDown?.Invoke(); } else if (input.GetKeyDown(settings.CloseHint)) { OnEscape?.Invoke(); } } }