Class SelectableGroup
- Namespace
- Fallencake.UI
- Assembly
- Fallencake.UI.dll
A group of selectable UI elements that manages selection state and interactions between buttons. Provides functionality for single/multiple selection modes and deselection behavior.
public class SelectableGroup : MonoBehaviour
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourSelectableGroup
Properties
AllowDeselection
Whether deselection is allowed when clicking again
public bool AllowDeselection { get; set; }
Property Value
- bool
AllowMultipleSelection
Whether multiple selection is allowed
public bool AllowMultipleSelection { get; set; }
Property Value
- bool
SelectedSelectable
First selected element (for compatibility)
public IGroupSelectable SelectedSelectable { get; }
Property Value
SelectedSelectables
Current selected elements
public IReadOnlyList<IGroupSelectable> SelectedSelectables { get; }
Property Value
- IReadOnlyList<IGroupSelectable>
Methods
AddSelectable(IGroupSelectable)
Adds a selectable element to the group
public void AddSelectable(IGroupSelectable selectable)
Parameters
selectableIGroupSelectable
ForceDeselect(IGroupSelectable)
Forces deselection of an element
public void ForceDeselect(IGroupSelectable selectable)
Parameters
selectableIGroupSelectable
ForceSelect(IGroupSelectable)
Forces selection of an element
public void ForceSelect(IGroupSelectable selectable)
Parameters
selectableIGroupSelectable
OnSelectionChanged()
Called when selection changes in the group
protected virtual void OnSelectionChanged()
RemoveSelectable(IGroupSelectable)
Removes a selectable element from the group
public void RemoveSelectable(IGroupSelectable selectable)
Parameters
selectableIGroupSelectable
SelectSelectable(IGroupSelectable)
Selects or deselects an element
public void SelectSelectable(IGroupSelectable selectable)
Parameters
selectableIGroupSelectable
UnselectAll()
Deselects all elements
public void UnselectAll()