Class KaijuSeekMovement
Seek steering behaviour.
Inheritance
Inherited Members
Namespace: KaijuSolutions.Agents.Movement
Syntax
public class KaijuSeekMovement : KaijuApproachingMovement
Constructors
KaijuSeekMovement(KaijuAgent, Component, Single, Single)
Create a seek movement.
Declaration
public KaijuSeekMovement(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 seek to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuSeekMovement(KaijuAgent, GameObject, Single, Single)
Create a seek movement.
Declaration
public KaijuSeekMovement(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 seek to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuSeekMovement(KaijuAgent, Vector2, Single, Single)
Create a seek movement.
Declaration
public KaijuSeekMovement(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 seek to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuSeekMovement(KaijuAgent, Vector3, Single, Single)
Create a seek movement.
Declaration
public KaijuSeekMovement(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 seek to. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
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
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 seek movement.
Declaration
public static KaijuSeekMovement 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 seek be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuSeekMovement | Get a seek movement for the KaijuAgent. |
Get(KaijuAgent, GameObject, Single, Single)
Get a seek movement.
Declaration
public static KaijuSeekMovement 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 seek be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuSeekMovement | Get a seek movement for the KaijuAgent. |
Get(KaijuAgent, Vector2, Single, Single)
Get a seek movement.
Declaration
public static KaijuSeekMovement 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 seek be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuSeekMovement | Get a seek movement for the KaijuAgent. |
Get(KaijuAgent, Vector3, Single, Single)
Get a seek movement.
Declaration
public static KaijuSeekMovement 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 seek be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuSeekMovement | Get a seek movement for the KaijuAgent. |