![]() |
SpaceRTS - Starter Pack
1.3
|
GameEntityComponent that gives to the GameEntity the property of been able to build buildable entities. More...
Classes | |
struct | BuildItem |
Struct info for each build item in the queue More... | |
Public Member Functions | |
virtual bool | IsBuilding () |
Returns true if this builder is actually working over a buildable. More... | |
void | Build (UnitConfig toBuild) |
Request the 'toBuild' unit to be built. More... | |
void | AddUnitToBuild (UnitConfig toBuild, Vector3 location, Vector3 dir) |
Adds a Unit of type UnitConfig to the build queue. More... | |
void | SetupBuild (Buildable buildable) |
Sets the given buildable as as the current working target to build. More... | |
virtual bool | CanBuildBeStarted () |
Indicates if the current build work can be started More... | |
void | CancelCurrentBuild () |
Cancels the current build. More... | |
void | CancelBuildAt (int index) |
Removes the build item from the queue, also cancel the build if index is zero. More... | |
bool | CanBuild (Buildable buildable) |
Indicates if the buildable can be built by this builder. More... | |
Buildable | CreateBuildable (UnitConfig toBuild, Vector3 location, Quaternion rotation, Transform parent) |
Creates the Buildable object with the visual module of the final object. This object should control the build process until it's finished. More... | |
![]() | |
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... | |
Public Attributes | |
Buildable | constructPrefab |
The temporal prefab to use as gameplay controller for the constructed unit, until its finished. More... | |
List< UnitConfig > | buildables = new List<UnitConfig>() |
List of Units that this one is capable of build. More... | |
float | buildRate = 1.0f |
Means how many buildPoints will be built per second according with the Buildable.buildPoints. More... | |
Action | BuildQueueChanged |
Triggered each time the internal build queue changes. More... | |
Action | BuildStarted |
Triggered each time the build progress starts by any builder. More... | |
Action | BuildCompleted |
Triggered after each build progress is completed. More... | |
Action | UnableToBuild |
Triggered when the builder its about to build but one of the conditions has failed. More... | |
Action | BuildCanceled |
Triggered after each build progress is canceled. More... | |
Protected Member Functions | |
virtual Transform | GetBuildableParent () |
Returns the transform that must be used as parent for the instantiated buildable. Must be overiden to change its behaviour, will use the builder's transform parent as default transform to be used as parent of the buildable. More... | |
abstract void | OnBuildRequested (UnitConfig toBuild) |
abstract void | OnWorkOverBuildableRequested (Buildable buildable) |
overridable method to control how must procceed after a buildable was requested as next target to build. More... | |
void | StartBuildProgress () |
Starts the build progress for the current buildable target. More... | |
virtual void | OnBuildCompleted () |
![]() | |
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... | |
T | GetSceneSystem< T > () |
Shortcut for access a SceneSystem registered in the GameScene. More... | |
T | 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... | |
Protected Attributes | |
List< BuildItem > | buildQueue = new List<BuildItem>() |
Build queue holding the list of units to build. More... | |
Properties | |
bool | HasTarget [get] |
has a buildable target assigned? More... | |
Buildable | BuildTarget [get] |
Buildable target asigned to this builder. can be null if there is no buildable assigned. More... | |
abstract bool | RemoveOnInterrupt [get] |
Indicated if the builder must delete the buildable unit when interrupted. More... | |
Vector3 | RallyPointOffset [get] |
Offset from the Builder position to the rally point. Deprecated. Use BuildExpelLocation instead. More... | |
float | UnitRadius [get, set] |
Means the radius of this builder unit. Its used to calculate distance between the builder and the buildable. Probably it's not the proper place to have this property, maybe in a more spatialy related component. For now, its here because its the only one that its realy using it. More... | |
int | BuildsInQueue [get] |
Indicates the current quantity of units to build in the queue. More... | |
Conditionals< Buildable > | BuildConditionals [get] |
A list of conditionals to check if its possible to start to build the buildable passed as parameter. only when all of this conditionals returns true then the construction will start. More... | |
IEnumerable< UnitConfig > | QueuedUnits [get] |
Enumerates the units to build in queue. More... | |
![]() | |
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... | |
GameEntityComponent that gives to the GameEntity the property of been able to build buildable entities.
void NullPointerGame.BuildSystem.Builder.AddUnitToBuild | ( | UnitConfig | toBuild, |
Vector3 | location, | ||
Vector3 | dir | ||
) |
Adds a Unit of type UnitConfig to the build queue.
toBuild | Unit tye to be builded. |
location | location where be built the unit. |
dir | Face direction that will have the builded unit once completed. |
void NullPointerGame.BuildSystem.Builder.Build | ( | UnitConfig | toBuild | ) |
Request the 'toBuild' unit to be built.
toBuild | The unit configuration to be built. |
bool NullPointerGame.BuildSystem.Builder.CanBuild | ( | Buildable | buildable | ) |
Indicates if the buildable can be built by this builder.
buildable | The buildable to check. |
|
virtual |
Indicates if the current build work can be started
void NullPointerGame.BuildSystem.Builder.CancelBuildAt | ( | int | index | ) |
Removes the build item from the queue, also cancel the build if index is zero.
index |
void NullPointerGame.BuildSystem.Builder.CancelCurrentBuild | ( | ) |
Cancels the current build.
Buildable NullPointerGame.BuildSystem.Builder.CreateBuildable | ( | UnitConfig | toBuild, |
Vector3 | location, | ||
Quaternion | rotation, | ||
Transform | parent | ||
) |
Creates the Buildable object with the visual module of the final object. This object should control the build process until it's finished.
toBuild | The config info of the object to build. |
location | The world coords of the object builded. |
rotation | The rotation that will have the object during its build process. |
parent | The parent transform fo the new created buildable entity. |
|
protectedvirtual |
Returns the transform that must be used as parent for the instantiated buildable. Must be overiden to change its behaviour, will use the builder's transform parent as default transform to be used as parent of the buildable.
Reimplemented in NullPointerGame.BuildSystem.StaticBuilder.
|
virtual |
Returns true if this builder is actually working over a buildable.
|
protectedvirtual |
Reimplemented in NullPointerGame.BuildSystem.StaticBuilder, and NullPointerGame.BuildSystem.MobileBuilder.
|
protectedpure virtual |
Implemented in NullPointerGame.BuildSystem.StaticBuilder, and NullPointerGame.BuildSystem.MobileBuilder.
|
protectedpure virtual |
overridable method to control how must procceed after a buildable was requested as next target to build.
buildable | The buildable requested to build. |
Implemented in NullPointerGame.BuildSystem.StaticBuilder, and NullPointerGame.BuildSystem.MobileBuilder.
void NullPointerGame.BuildSystem.Builder.SetupBuild | ( | Buildable | buildable | ) |
Sets the given buildable as as the current working target to build.
buildable | the buildable to be used as target to build. |
|
protected |
Starts the build progress for the current buildable target.
List<UnitConfig> NullPointerGame.BuildSystem.Builder.buildables = new List<UnitConfig>() |
List of Units that this one is capable of build.
Action NullPointerGame.BuildSystem.Builder.BuildCanceled |
Triggered after each build progress is canceled.
Action NullPointerGame.BuildSystem.Builder.BuildCompleted |
Triggered after each build progress is completed.
Build queue holding the list of units to build.
Action NullPointerGame.BuildSystem.Builder.BuildQueueChanged |
Triggered each time the internal build queue changes.
float NullPointerGame.BuildSystem.Builder.buildRate = 1.0f |
Means how many buildPoints will be built per second according with the Buildable.buildPoints.
Action NullPointerGame.BuildSystem.Builder.BuildStarted |
Triggered each time the build progress starts by any builder.
Buildable NullPointerGame.BuildSystem.Builder.constructPrefab |
The temporal prefab to use as gameplay controller for the constructed unit, until its finished.
Action NullPointerGame.BuildSystem.Builder.UnableToBuild |
Triggered when the builder its about to build but one of the conditions has failed.
|
get |
A list of conditionals to check if its possible to start to build the buildable passed as parameter. only when all of this conditionals returns true then the construction will start.
|
get |
Indicates the current quantity of units to build in the queue.
|
get |
Buildable target asigned to this builder. can be null if there is no buildable assigned.
|
get |
has a buildable target assigned?
|
get |
Enumerates the units to build in queue.
|
get |
Offset from the Builder position to the rally point. Deprecated. Use BuildExpelLocation instead.
|
get |
Indicated if the builder must delete the buildable unit when interrupted.
|
getset |
Means the radius of this builder unit. Its used to calculate distance between the builder and the buildable.
Probably it's not the proper place to have this property, maybe in a more spatialy related component. For now, its here because its the only one that its realy using it.