SpaceRTS - Starter Pack  1.3
GameBase.SelectionSystem Class Reference

The system in control of all GameEntities that can be hovered, highlighted and selected. More...

Inheritance diagram for GameBase.SelectionSystem:
GameBase.GameSceneSystem

Public Member Functions

IEnumerable< SelectableCollectSelectablesInBounds (Bounds viewportBounds)
 Collects all Selectables whose BoundCollider center is inside the given Camera viewport bounds. More...
 
Selectable GetSelectable (Collider colliderToCheck)
 Given a collider find its matching Selectable. More...
 
IEnumerable< SelectableCollectSelectables (IEnumerable< Collider > collidersToCheck)
 Collects each selectable matching their given BoundColliders. More...
 
void SetAsHovering (IEnumerable< Selectable > selectablesToHover)
 Marks each selectable as Hovered and remove hovered mark for each already hovered selectables that are not in selectablesToHover. More...
 
void ConfirmAllHighlightsAsSelected ()
 Marks all selectables currently highlighted as selected. More...
 
void RemoveAllHovering ()
 Removes hover mark of each already hovering selectables (removes also its highlight mark if they have) More...
 
void RemoveHovering (Selectable toUnhover)
 
void SetAsHighlighted (IEnumerable< Selectable > selectablesToHighligh)
 Marks each Selectable as Highlighted. each Selectable in selectablesToHighligh must be already marked as hovered in order to also be highlighted. More...
 
- Public Member Functions inherited from GameBase.GameSceneSystem
virtual void GenerateDefaultValues ()
 

Public Attributes

Action< GameEntityselectionAddedEntity
 
Action< GameEntityselectionRemovedEntity
 
Action selectionRemovedAll
 

Properties

int SelectedEntitiesCount [get]
 Count of Selectables selecteds. More...
 
bool HasSelectedEntities [get]
 There's at least one Selectable selected? More...
 
IEnumerable< SelectableSelecteds [get]
 Returns a IEnumerable<Selectable> containing all the selecteds Selectables. More...
 
bool HasHoveredEntities [get]
 There's at least one Selectable hovered? More...
 
IEnumerable< SelectableHoverings [get]
 Returns a IEnumerable<Selectable> containing all the hovered Selectables. More...
 
List< SelectableOrderedHoveringEntities [get]
 Returns a list of ordered Selectables. That order is given by the SelectionOrder wich is a value increased each time a hovered entity is selected. This allows us to known from all the currently hovered entities which one was already selected and which one not. More...
 
- Properties inherited from GameBase.GameSceneSystem
GameScene gameScene [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from GameBase.GameSceneSystem
static bool ValidateExists< T > (UnityEngine.Object context)
 
static void CreateDefault< T > (UnityEngine.Object context)
 
static T Find< T > (UnityEngine.Object context)
 
static T GetValid< T > (UnityEngine.Object context)
 
- Protected Member Functions inherited from GameBase.GameSceneSystem
virtual void OnValidate ()
 Finds the GameScene in the current hierarchy going from parent to parent. Also registers the scene system in that GameScene. More...
 
virtual void Reset ()
 
virtual void ValidateSceneSystem ()
 

Detailed Description

The system in control of all GameEntities that can be hovered, highlighted and selected.

Member Function Documentation

◆ CollectSelectables()

IEnumerable<Selectable> GameBase.SelectionSystem.CollectSelectables ( IEnumerable< Collider >  collidersToCheck)

Collects each selectable matching their given BoundColliders.

Parameters
collidersToCheck
Returns
Returns an IEnumerable<Selectable> which has selectables matching their given BoundCollider.

◆ CollectSelectablesInBounds()

IEnumerable<Selectable> GameBase.SelectionSystem.CollectSelectablesInBounds ( Bounds  viewportBounds)

Collects all Selectables whose BoundCollider center is inside the given Camera viewport bounds.

Parameters
viewportBoundsThe viewport bounds where to collect the matching Selectables
Returns
A IEnumerable<Selectable> with each BoundCollider inside the viewport bounds.

◆ ConfirmAllHighlightsAsSelected()

void GameBase.SelectionSystem.ConfirmAllHighlightsAsSelected ( )

Marks all selectables currently highlighted as selected.

◆ GetSelectable()

Selectable GameBase.SelectionSystem.GetSelectable ( Collider  colliderToCheck)

Given a collider find its matching Selectable.

Parameters
colliderToCheckThe collider matching the requested selectable.
Returns
A Selectable matching their given BoundCollider.

◆ RemoveAllHovering()

void GameBase.SelectionSystem.RemoveAllHovering ( )

Removes hover mark of each already hovering selectables (removes also its highlight mark if they have)

◆ RemoveHovering()

void GameBase.SelectionSystem.RemoveHovering ( Selectable  toUnhover)

◆ SetAsHighlighted()

void GameBase.SelectionSystem.SetAsHighlighted ( IEnumerable< Selectable selectablesToHighligh)

Marks each Selectable as Highlighted. each Selectable in selectablesToHighligh must be already marked as hovered in order to also be highlighted.

Parameters
selectablesToHighlighEnumerable with the group of hovered Selectables to be highlighted.

◆ SetAsHovering()

void GameBase.SelectionSystem.SetAsHovering ( IEnumerable< Selectable selectablesToHover)

Marks each selectable as Hovered and remove hovered mark for each already hovered selectables that are not in selectablesToHover.

Parameters
selectablesToHover

Member Data Documentation

◆ selectionAddedEntity

Action<GameEntity> GameBase.SelectionSystem.selectionAddedEntity

◆ selectionRemovedAll

Action GameBase.SelectionSystem.selectionRemovedAll

◆ selectionRemovedEntity

Action<GameEntity> GameBase.SelectionSystem.selectionRemovedEntity

Property Documentation

◆ HasHoveredEntities

bool GameBase.SelectionSystem.HasHoveredEntities
get

There's at least one Selectable hovered?

◆ HasSelectedEntities

bool GameBase.SelectionSystem.HasSelectedEntities
get

There's at least one Selectable selected?

◆ Hoverings

IEnumerable<Selectable> GameBase.SelectionSystem.Hoverings
get

Returns a IEnumerable<Selectable> containing all the hovered Selectables.

◆ OrderedHoveringEntities

List<Selectable> GameBase.SelectionSystem.OrderedHoveringEntities
get

Returns a list of ordered Selectables. That order is given by the SelectionOrder wich is a value increased each time a hovered entity is selected. This allows us to known from all the currently hovered entities which one was already selected and which one not.

◆ SelectedEntitiesCount

int GameBase.SelectionSystem.SelectedEntitiesCount
get

Count of Selectables selecteds.

◆ Selecteds

IEnumerable<Selectable> GameBase.SelectionSystem.Selecteds
get

Returns a IEnumerable<Selectable> containing all the selecteds Selectables.