SpaceRTS - Starter Pack  1.3
GameBase.Selectable Class Reference

Component in charge of store the current status for hover, highlight and selection. More...

Inheritance diagram for GameBase.Selectable:
GameBase.GameEntityComponent

Public Member Functions

override void OnVisualModuleSetted ()
 Called when the Visual Module is setted. Here we need to initialize all the component related functionality. More...
 
override void OnVisualModuleRemoved ()
 Called when the Visual Module is removed. Here we need to uninitialize all the component related functionality. More...
 

Public Attributes

ProxyRef selectionCollider = new ProxyRef(typeof(Collider), "selectable")
 Collider reference to use as selection check. More...
 
Action Selected
 Action triggered whenever the GameEntity becomes Selected according to the SelectionSystem. More...
 
Action Unselected
 Action triggered whenever the GameEntity becomes Unselected according to the SelectionSystem. More...
 
Action Highligted
 Action triggered whenever the GameEntity becomes highlighted according to the SelectionSystem. More...
 
Action Unhighligted
 Action triggered whenever the GameEntity becomes unhighlighted according to the SelectionSystem. More...
 
Action Hovered
 Action triggered whenever the GameEntity becomes hovered according to the SelectionSystem. More...
 
Action Unhovered
 Action triggered whenever the GameEntity becomes unhovered according to the SelectionSystem. More...
 

Properties

int SelectionOrder [get]
 Returns the current selection order. (This value is increased after each selection and reseted after the GameEntity is no longer hovered). More...
 
bool IsSelected [get]
 Returns the current selection status. More...
 
bool IsHovered [get]
 Returns the current hovered status. More...
 
bool IsHighlighted [get]
 Returns the current highlight status. More...
 
Collider BoundCollider [get]
 The boundung collider used for detection of the selection. More...
 
- Properties inherited from GameBase.GameEntityComponent
GameEntity ThisEntity [get]
 The GameEntity attached to this component. More...
 
MessageSink Messages [get]
 Shortcut for the Message sink located at the GameEntity attached to this component. More...
 
ComponentProxy VisualProxy [get]
 Shortcut for the ComponentProxy located at the GameEntity attached to this component. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GameBase.GameEntityComponent
virtual void SetupEntityComponent ()
 virtual class to be implemented. This will be called on the Awake to do a proper initialization of the component ensuring that the GameEntity thisEntity it's already defined at this point. Version 1.1: This will no longer be used in the future. Use instead OnVisualModuleSetted and OnVisualModuleRemoved. More...
 
virtual void OnValidate ()
 Called by unity when the script is reloaded. Here we setup the component and check that all is setted correctly. More...
 
GetSceneSystem< T > ()
 Shortcut for access a SceneSystem registered in the GameScene. More...
 
GetVisualProxyProperty< T > (string name)
 Shortcut for access the property located at the GameEntity visual module. More...
 
void LogsClear ()
 Clears all log messages More...
 
void Log (string message)
 Stores the message as a log that can be used later to show a warning in the editor or console. More...
 
void PushLogs ()
 Push all the stored logs to the console. More...
 

Detailed Description

Component in charge of store the current status for hover, highlight and selection.

Member Function Documentation

◆ OnVisualModuleRemoved()

override void GameBase.Selectable.OnVisualModuleRemoved ( )
virtual

Called when the Visual Module is removed. Here we need to uninitialize all the component related functionality.

Reimplemented from GameBase.GameEntityComponent.

◆ OnVisualModuleSetted()

override void GameBase.Selectable.OnVisualModuleSetted ( )
virtual

Called when the Visual Module is setted. Here we need to initialize all the component related functionality.

Reimplemented from GameBase.GameEntityComponent.

Member Data Documentation

◆ Highligted

Action GameBase.Selectable.Highligted

Action triggered whenever the GameEntity becomes highlighted according to the SelectionSystem.

◆ Hovered

Action GameBase.Selectable.Hovered

Action triggered whenever the GameEntity becomes hovered according to the SelectionSystem.

◆ Selected

Action GameBase.Selectable.Selected

Action triggered whenever the GameEntity becomes Selected according to the SelectionSystem.

◆ selectionCollider

ProxyRef GameBase.Selectable.selectionCollider = new ProxyRef(typeof(Collider), "selectable")

Collider reference to use as selection check.

◆ Unhighligted

Action GameBase.Selectable.Unhighligted

Action triggered whenever the GameEntity becomes unhighlighted according to the SelectionSystem.

◆ Unhovered

Action GameBase.Selectable.Unhovered

Action triggered whenever the GameEntity becomes unhovered according to the SelectionSystem.

◆ Unselected

Action GameBase.Selectable.Unselected

Action triggered whenever the GameEntity becomes Unselected according to the SelectionSystem.

Property Documentation

◆ BoundCollider

Collider GameBase.Selectable.BoundCollider
get

The boundung collider used for detection of the selection.

◆ IsHighlighted

bool GameBase.Selectable.IsHighlighted
get

Returns the current highlight status.

◆ IsHovered

bool GameBase.Selectable.IsHovered
get

Returns the current hovered status.

◆ IsSelected

bool GameBase.Selectable.IsSelected
get

Returns the current selection status.

◆ SelectionOrder

int GameBase.Selectable.SelectionOrder
get

Returns the current selection order. (This value is increased after each selection and reseted after the GameEntity is no longer hovered).