public void OnButtonDeselected(SelectableButton selectable) { if (_cantBeUnselected && _selectedButton == selectable) { return; } selectable.Deselect(); DeselectFunction(selectable); _selectedButton = null; ResetButtons(); }
public void OnButtonSelected(SelectableButton selectable) { //if (selectable.InteractableWhenSelected) if (_selectedButton != null) { _selectedButton.Deselect(); DeselectFunction(_selectedButton); _selectedButton = null; } ResetButtons(); _selectedButton = selectable; selectable.ButtonImage.color = _selectedColor; selectable.ChangeInImageColor(_spriteSelectedColor); selectable.Select(); SelectFunction(selectable); }