![]() |
SpaceRTS - Starter Pack
1.3
|
Component that controls the navigation during a parking sequence agains another entity. Requires a Parking system in the destination target. More...
Classes | |
interface | IParkingEvents |
Interface to deliver the main events during the parking sequence. More... | |
class | ParkingJob |
class that handles the parking job once a slot is assigned to it. More... | |
Public Member Functions | |
void | Start () |
void | RequestParkingSlot (Parking parking, IParkingEvents parkingControl=null) |
Request a parking slot at the given parking system. More... | |
void | ForceParkingSlot (Parking parking, IParkingEvents parkingControl=null) |
Request a parking slot no matter the actual position of the entity. More... | |
void | CancelParkingRequest () |
Cancels the current parking request, sends the entity to the exit position if the actual parkig job was already started. More... | |
void | ForceCancelParkingRequest () |
void | OnJobSlotAssigned (SimpleJob job, SimpleScheduler.JobSlot slot) |
Called after a parking slot is requested to the parking system, and that system assigns a slot to it. More... | |
void | OnJobSlotRemoved (SimpleJob job) |
Called once the slot is removed from the parking job. More... | |
T | GetParkingSlot< T > () |
Converts the current assigned slot to the type passed as T in the method. 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 | |
Action | ParkingSlotEnter |
Action that is called once the parkable reachs the exact slot position. More... | |
Action | ParkingSlotExit |
Action that is called once the parking is canceled and the parkable is at the slot position. More... | |
Action | ParkingEnded |
Action that is called once the parkable leaves the parking slot and reachs the exit position. More... | |
Protected Member Functions | |
virtual void | OnParkingEnded () |
Called once the total parking job was ended. Can be overrided to extend its behaviour. More... | |
![]() | |
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... | |
Properties | |
bool | IsParked [get] |
Indicates if the parkable is actually parking at the assigned slot. More... | |
Navigation | Nav [get] |
Shortcut and cache to the Navigation component used by this component. More... | |
ParkingJob | ThisParkingJob [get] |
Shortcut to a valid cache of the parking job associated with this parkable. 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... | |
Component that controls the navigation during a parking sequence agains another entity. Requires a Parking system in the destination target.
When a paking slot is requested this parkable will move the entity close to the target (in the wait area of the parking) and through its Navigation component.
Once reached, internally will request to the parking system a parking slot and will wait until the the assignment. Then moves to the slot position and informs through the ParkingSlotEnter action that the position was reached.
A call to CancelParkingRequest() will be needed to release the slot and exit the position.
void NullPointerGame.ParkingSystem.Parkable.CancelParkingRequest | ( | ) |
Cancels the current parking request, sends the entity to the exit position if the actual parkig job was already started.
void NullPointerGame.ParkingSystem.Parkable.ForceCancelParkingRequest | ( | ) |
void NullPointerGame.ParkingSystem.Parkable.ForceParkingSlot | ( | Parking | parking, |
IParkingEvents | parkingControl = null |
||
) |
Request a parking slot no matter the actual position of the entity.
This method is similar to the RequestParkingSlot method but in that case the Parkable will try to move the entity close to the Parking entity and then the slot will be requested. Here the slot will be requested regardless of the actual position.
parking | The parking system where to request a slot. |
parkingControl | Interface that acts as a callback to inform the parking events sequence during the parking. |
T NullPointerGame.ParkingSystem.Parkable.GetParkingSlot< T > | ( | ) |
Converts the current assigned slot to the type passed as T in the method.
T | Type where to be casted the parking slot. |
T | : | SimpleScheduler.JobSlot |
void NullPointerGame.ParkingSystem.Parkable.OnJobSlotAssigned | ( | SimpleJob | job, |
SimpleScheduler.JobSlot | slot | ||
) |
Called after a parking slot is requested to the parking system, and that system assigns a slot to it.
Remember that the slot request goes to a ordered wait queue, so a slot will be assigned only if it's the correct turn of the entity.
job | The job provided by this Parkable where to assign the slot. |
slot | The Parking slot assigned by the system. |
Implements NullPointerCore.Backend.JobScheduling.SimpleJob.ISlotChanged.
void NullPointerGame.ParkingSystem.Parkable.OnJobSlotRemoved | ( | SimpleJob | job | ) |
Called once the slot is removed from the parking job.
job | The job provided by this Parkable and where the slot was removed. |
Implements NullPointerCore.Backend.JobScheduling.SimpleJob.ISlotChanged.
|
protectedvirtual |
Called once the total parking job was ended. Can be overrided to extend its behaviour.
void NullPointerGame.ParkingSystem.Parkable.RequestParkingSlot | ( | Parking | parking, |
IParkingEvents | parkingControl = null |
||
) |
Request a parking slot at the given parking system.
parking | The parking system where to request a slot. |
parkingControl | Interface that acts as a callback to inform the parking events sequence during the parking. |
void NullPointerGame.ParkingSystem.Parkable.Start | ( | ) |
Action NullPointerGame.ParkingSystem.Parkable.ParkingEnded |
Action that is called once the parkable leaves the parking slot and reachs the exit position.
Action NullPointerGame.ParkingSystem.Parkable.ParkingSlotEnter |
Action that is called once the parkable reachs the exact slot position.
Action NullPointerGame.ParkingSystem.Parkable.ParkingSlotExit |
Action that is called once the parking is canceled and the parkable is at the slot position.
|
get |
Indicates if the parkable is actually parking at the assigned slot.
|
get |
Shortcut and cache to the Navigation component used by this component.
|
getprotected |
Shortcut to a valid cache of the parking job associated with this parkable.