ISelectable Interface

ISelectable is an interface that defines the properties and behaviors required for objects that can be selected in a game system.

❗ Please refer to the "ISelectable Implementation Example" section.

Properties

gameObject

  • Type: GameObject

  • Description: Reference to the Unity GameObject that implements this interface.

SelectionPriority1

  • Type: int

  • Description: Primary selection priority value. Used for primary filtering of selectable objects.

SelectionPriority2

  • Type: int

  • Description: Secondary selection priority value. Used for secondary filtering of selectable objects.

SelectionPriority3

  • Type: int

  • Description: Tertiary selection priority value. Used for tertiary filtering of selectable objects.

Order

  • Type: int

  • Description: Defines the ordering of selectable objects within a selection group.

SubGroupId

  • Type: int

  • Description: Identifier for grouping related selectable objects into subgroups.

CanBeMultiSelected

  • Type: bool

  • Description: Indicates whether the object can be part of a multiple selection.

CanBeGrouped

  • Type: bool

  • Description: Indicates whether the object can be grouped with other selectables.

OnSelectChanged

  • Type: UnityEvent<bool>

  • Description: Event triggered when the selection state of the object changes.

OnHoverChanged

  • Type: UnityEvent<bool>

  • Description: Event triggered when the hover state of the object changes.

Methods

IsSameSelectable

bool IsSameSelectable(ISelectable other)

Determines if two selectable objects are of the same type based on their priorities and subgroup.

  • Parameters:

    • other: Another ISelectable object to compare with

  • Returns: true if the objects are considered the same type, false otherwise

Last updated