Table of Contents

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
object
Object
Component
Behaviour
MonoBehaviour
SelectableGroup

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

IGroupSelectable

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

selectable IGroupSelectable

ForceDeselect(IGroupSelectable)

Forces deselection of an element

public void ForceDeselect(IGroupSelectable selectable)

Parameters

selectable IGroupSelectable

ForceSelect(IGroupSelectable)

Forces selection of an element

public void ForceSelect(IGroupSelectable selectable)

Parameters

selectable IGroupSelectable

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

selectable IGroupSelectable

SelectSelectable(IGroupSelectable)

Selects or deselects an element

public void SelectSelectable(IGroupSelectable selectable)

Parameters

selectable IGroupSelectable

UnselectAll()

Deselects all elements

public void UnselectAll()