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 HandleClassificationsSelectionChanged(int index, bool value) { var item = classifications[index]; if (value) { if (!selectedClassifications.Contains(item)) { selectedClassifications.Add(item); } } else { selectedClassifications.Remove(item); } OnCurrentEventChanged?.Invoke(); // allElementsToggle.SetIsOnWithoutNotify(selectedClassifications.Count > 0); }
private void RegisterSegmentedControlCallbacks(SegmentedControl item) { item.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke()); item.onValueChanged.AddListener(arg => ShowInfo()); }