Class KaijuPursueMovement
Pursue steering behaviour.
Inheritance
Inherited Members
Namespace: KaijuSolutions.Agents.Movement
Syntax
public class KaijuPursueMovement : KaijuSeekMovement
Constructors
KaijuPursueMovement(KaijuAgent, Component, Single, Single)
Create a pursue movement.
Declaration
public KaijuPursueMovement(KaijuAgent agent, Component target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| Component | target | The component to pursue to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuPursueMovement(KaijuAgent, GameObject, Single, Single)
Create a pursue movement.
Declaration
public KaijuPursueMovement(KaijuAgent agent, GameObject target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| GameObject | target | The GameObject to pursue to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuPursueMovement(KaijuAgent, Vector2, Single, Single)
Create a pursue movement.
Declaration
public KaijuPursueMovement(KaijuAgent agent, Vector2 target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| Vector2 | target | The position to pursue to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuPursueMovement(KaijuAgent, Vector3, Single, Single)
Create a pursue movement.
Declaration
public KaijuPursueMovement(KaijuAgent agent, Vector3 target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| Vector3 | target | The position to pursue to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
Fields
Previous
The previous position of the Target.
Declaration
public Vector2 Previous
Field Value
| Type | Description |
|---|---|
| Vector2 |
Properties
Future
The predicted future Target.
Declaration
public Vector2 Future { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Future3
The predicted future Target.
Declaration
public Vector3 Future3 { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Previous3
The previous position of the Target.
Declaration
public Vector3 Previous3 { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Methods
Calculate(Vector2, Single, Vector2, Single)
Calculate the movement.
Declaration
protected override Vector2 Calculate(Vector2 position, float speed, Vector2 target, float delta)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The KaijuAgent's current position. |
| System.Single | speed | The KaijuAgent's maximum movement speed. |
| Vector2 | target | The position to move in relation to. |
| System.Single | delta | The time step. |
Returns
| Type | Description |
|---|---|
| Vector2 | The calculated move vector. |
Overrides
EditorRenderVisualizations(Vector3)
Render the visualization of the KaijuMovement. The position of the Agent.
Declaration
protected override void EditorRenderVisualizations(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position |
Overrides
EditorVisualizationColor()
Get the color for visualizations.
Declaration
protected override Color EditorVisualizationColor()
Returns
| Type | Description |
|---|---|
| Color | The color for visualizations |
Overrides
Get(KaijuAgent, Component, Single, Single)
Get a pursue movement.
Declaration
public static KaijuPursueMovement Get(KaijuAgent agent, Component target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this will be assigned to. |
| Component | target | The target. |
| System.Single | distance | At what distance from the target should the pursue be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuPursueMovement | Get a pursue movement for the KaijuAgent. |
Get(KaijuAgent, GameObject, Single, Single)
Get a pursue movement.
Declaration
public static KaijuPursueMovement Get(KaijuAgent agent, GameObject target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this will be assigned to. |
| GameObject | target | The target. |
| System.Single | distance | At what distance from the target should the pursue be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuPursueMovement | Get a pursue movement for the KaijuAgent. |
Get(KaijuAgent, Vector2, Single, Single)
Get a pursue movement.
Declaration
public static KaijuPursueMovement Get(KaijuAgent agent, Vector2 target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this will be assigned to. |
| Vector2 | target | The target. |
| System.Single | distance | At what distance from the target should the pursue be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuPursueMovement | Get a pursue movement for the KaijuAgent. |
Get(KaijuAgent, Vector3, Single, Single)
Get a pursue movement.
Declaration
public static KaijuPursueMovement Get(KaijuAgent agent, Vector3 target, float distance = 0.1F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this will be assigned to. |
| Vector3 | target | The target. |
| System.Single | distance | At what distance from the target should the pursue be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuPursueMovement | Get a pursue movement for the KaijuAgent. |
Reset()
Perform any needed reset operations.
Declaration
protected override void Reset()
Overrides
Setup()
Handle any additional setup.
Declaration
protected override void Setup()