![]() |
SpaceRTS - Starter Pack
1.3
|
GameEntityComponent in control of the unit movement. More...
Classes | |
| class | Data |
| Movement configuration for the Navigation component More... | |
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... | |
| virtual void | Teleport (Vector3 position) |
| Instantly teleports the GameEntity to the given position maintaining the looking at direction. More... | |
| virtual void | Teleport (Vector3 position, Vector3 direction) |
| Instantly teleports the GameEntity to the given position and looking at the given direction More... | |
| virtual void | PrepareToMove (Vector3 position, Vector3 direction) |
| Initialize the movement configuration and show the destination marker at its final position. More... | |
| virtual void | PrepareToPursuit (Transform target, Vector3 offset, Vector3 direction) |
| void | ShowMoveMarkerAt (Vector3 pos) |
| virtual void | EngageMovement (Action< bool > onEnded=null) |
| Confirms the destination setted at PrepareToMove and starts the movement. More... | |
| virtual void | StopMovement () |
| Stops the current movement at the current position. More... | |
| virtual bool | IsFinalDestinationReached () |
| Determines whether the movement order is completed because the unit has reached the target position. More... | |
| void | LateUpdate () |
| Vector3 | Advance (Quaternion targetLookAt, float accel, bool applyMovement=true) |
| bool | DoRoll (Quaternion lookAt) |
| void | OnDrawGizmosSelected () |
Public Attributes | |
| const float | AngularSleepThreshold = 2.0f |
| ProxyRef | bodyToRoll = new ProxyRef(typeof(Transform), "roll_body") |
| float | baseOffset = 0.0f |
| The relative vertical displacement of the owning GameObject. More... | |
| GameObject | moveTargetMarker |
| Reference to the child GameObject that'll be used as destination feedback marker. Must contain a MeshRenderer in order to make it visible or hide it when needed. More... | |
| float | sqrTargetingPrecision = 1.0f |
| Square radius of the destination area where the destination target can be considered as reached. Deprecated. Use stoppingDistance instead. More... | |
| float | speed = 10.0f |
| The movement speed that will be used by this navigation. by default, speed will be the max speed (defined in moveConfig.maxSpeed). but you can set with this a slower velocity or a boost for a short time, etc. More... | |
| Data | moveConfig |
| Movement configuration to be used by this component. More... | |
| float | stoppingDistance = 1.0f |
| Stop within this distance from the target position. More... | |
| Action | DestinationChanged |
| Action | DestinationReached |
Protected Member Functions | |
| virtual void | Start () |
| virtual void | OnMovementOrderEngage (Vector3 destination) |
| Called after a EngageMovement order. Override to add special behaviours. More... | |
| virtual void | OnMovementOrderStop () |
| Called when a full stop order was given to this navigation. Override to add special behaviours. More... | |
| virtual void | OnMovingToDestination () |
| virtual void | OnMoveDestinationReached () |
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... | |
| 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 | |
| Vector3 | moveSpeed = Vector3.zero |
Properties | |
| Vector3 | BasePosition [get] |
| Vector3 | BaseOffset [get] |
| Vector3 | CurrentSpeed [get] |
| float | LastAcceleration [get] |
| Vector3 | Destination [get] |
| float | RemainingDistance [get] |
| Transform | BodyToRoll [get] |
| Returns the current used transform body where to apply the roll effect. 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... | |
GameEntityComponent in control of the unit movement.
| Vector3 NullPointerGame.NavigationSystem.Navigation.Advance | ( | Quaternion | targetLookAt, |
| float | accel, | ||
| bool | applyMovement = true |
||
| ) |
| bool NullPointerGame.NavigationSystem.Navigation.DoRoll | ( | Quaternion | lookAt | ) |
|
virtual |
Confirms the destination setted at PrepareToMove and starts the movement.
| onEnded | Callback to be called when the destination is reached or changed. |
|
virtual |
Determines whether the movement order is completed because the unit has reached the target position.
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
| void NullPointerGame.NavigationSystem.Navigation.LateUpdate | ( | ) |
| void NullPointerGame.NavigationSystem.Navigation.OnDrawGizmosSelected | ( | ) |
|
protectedvirtual |
|
protectedvirtual |
Called after a EngageMovement order. Override to add special behaviours.
| destination | The target point in world coordinates where to move the unit. |
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
protectedvirtual |
Called when a full stop order was given to this navigation. Override to add special behaviours.
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
protectedvirtual |
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
virtual |
Called when the Visual Module is removed. Here we need to uninitialize all the component related functionality.
Reimplemented from GameBase.GameEntityComponent.
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
virtual |
Called when the Visual Module is setted. Here we need to initialize all the component related functionality.
Reimplemented from GameBase.GameEntityComponent.
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
virtual |
Initialize the movement configuration and show the destination marker at its final position.
| position | Final destination of the movement. |
| direction | Final look at direction for the unit once the destination is reached. |
|
virtual |
| void NullPointerGame.NavigationSystem.Navigation.ShowMoveMarkerAt | ( | Vector3 | pos | ) |
|
protectedvirtual |
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
virtual |
Stops the current movement at the current position.
|
virtual |
Instantly teleports the GameEntity to the given position maintaining the looking at direction.
| position | The new position where must be located thee game entity. |
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
|
virtual |
Instantly teleports the GameEntity to the given position and looking at the given direction
| position | The new position where must be located thee game entity. |
| direction | The new direction that must be looking at the game entity. |
Reimplemented in NullPointerGame.NavigationSystem.NavMeshNavigation.
| const float NullPointerGame.NavigationSystem.Navigation.AngularSleepThreshold = 2.0f |
| float NullPointerGame.NavigationSystem.Navigation.baseOffset = 0.0f |
The relative vertical displacement of the owning GameObject.
| ProxyRef NullPointerGame.NavigationSystem.Navigation.bodyToRoll = new ProxyRef(typeof(Transform), "roll_body") |
| Action NullPointerGame.NavigationSystem.Navigation.DestinationChanged |
| Action NullPointerGame.NavigationSystem.Navigation.DestinationReached |
| Data NullPointerGame.NavigationSystem.Navigation.moveConfig |
Movement configuration to be used by this component.
|
protected |
| GameObject NullPointerGame.NavigationSystem.Navigation.moveTargetMarker |
Reference to the child GameObject that'll be used as destination feedback marker. Must contain a MeshRenderer in order to make it visible or hide it when needed.
| float NullPointerGame.NavigationSystem.Navigation.speed = 10.0f |
The movement speed that will be used by this navigation. by default, speed will be the max speed (defined in moveConfig.maxSpeed). but you can set with this a slower velocity or a boost for a short time, etc.
| float NullPointerGame.NavigationSystem.Navigation.sqrTargetingPrecision = 1.0f |
Square radius of the destination area where the destination target can be considered as reached. Deprecated. Use stoppingDistance instead.
| float NullPointerGame.NavigationSystem.Navigation.stoppingDistance = 1.0f |
Stop within this distance from the target position.
|
get |
|
get |
|
getprotected |
Returns the current used transform body where to apply the roll effect.
|
get |
|
get |
|
get |
|
get |