SpaceRTS - Starter Pack  1.3
GameBase.GameEntityComponent Class Reference

Base class for all the Components that need to comunicate with the GameEntity and it's Visual Module. More...

Inheritance diagram for GameBase.GameEntityComponent:
GameBase.Selectable NullPointerCore.CoreSystem.PlayerControlled NullPointerGame.BuildSystem.Buildable NullPointerGame.BuildSystem.Builder NullPointerGame.DamageSystem.AttackCapable NullPointerGame.DamageSystem.Damageable NullPointerGame.NavigationSystem.Navigation NullPointerGame.ParkingSystem.Parkable NullPointerGame.ResourceSystem.StorageController NullPointerGame.Spatial.BuildLocationValidator NullPointerGame.Spatial.SpatialUpdate SpaceRTSKit.Core.RTSEntity SpaceRTSKit.Core.RTSShipCarrier SpaceRTSKit.Core.RTSUnitHUD SpaceRTSKit.Core.UnitSpawner SpaceRTSKit.Core.UnitSpawnerInArea SpaceRTSKit.FeedbackAndEffects.ConstructFeedback SpaceRTSKit.FeedbackAndEffects.ExtractionFeedback SpaceRTSKit.FeedbackAndEffects.SelectionFeedback SpaceRTSKit.FeedbackAndEffects.ShipMoveFeedback

Public Member Functions

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

Protected Member Functions

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...
 

Properties

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...
 

Detailed Description

Base class for all the Components that need to comunicate with the GameEntity and it's Visual Module.

Member Function Documentation

◆ GetSceneSystem< T >()

T GameBase.GameEntityComponent.GetSceneSystem< T > ( )
protected

Shortcut for access a SceneSystem registered in the GameScene.

Template Parameters
TMust inherit from GameSceneSystem.
Returns
The already casted scene system.
Type Constraints
T :GameSceneSystem 

◆ GetVisualProxyProperty< T >()

T GameBase.GameEntityComponent.GetVisualProxyProperty< T > ( string  name)
protected

Shortcut for access the property located at the GameEntity visual module.

Template Parameters
TType of the request Component.
Parameters
nameName of the requested property.
Returns
The component returned by the visual module.
Type Constraints
T :Component 

◆ Log()

void GameBase.GameEntityComponent.Log ( string  message)
protected

Stores the message as a log that can be used later to show a warning in the editor or console.

Parameters
message

◆ LogsClear()

void GameBase.GameEntityComponent.LogsClear ( )
protected

Clears all log messages

◆ OnValidate()

virtual void GameBase.GameEntityComponent.OnValidate ( )
protectedvirtual

Called by unity when the script is reloaded. Here we setup the component and check that all is setted correctly.

Reimplemented in NullPointerGame.ResourceSystem.ResourceCollector.

◆ OnVisualModuleRemoved()

◆ OnVisualModuleSetted()

◆ PushLogs()

void GameBase.GameEntityComponent.PushLogs ( )
protected

Push all the stored logs to the console.

◆ SetupEntityComponent()

virtual void GameBase.GameEntityComponent.SetupEntityComponent ( )
protectedvirtual

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.

Property Documentation

◆ Messages

MessageSink GameBase.GameEntityComponent.Messages
get

Shortcut for the Message sink located at the GameEntity attached to this component.

◆ ThisEntity

GameEntity GameBase.GameEntityComponent.ThisEntity
get

The GameEntity attached to this component.

◆ VisualProxy

ComponentProxy GameBase.GameEntityComponent.VisualProxy
get

Shortcut for the ComponentProxy located at the GameEntity attached to this component.