Class KaijuFleeMovement
Flee steering behaviour.
Inheritance
Inherited Members
Namespace: KaijuSolutions.Agents.Movement
Syntax
public class KaijuFleeMovement : KaijuLeavingMovement
Constructors
KaijuFleeMovement(KaijuAgent, Component, Single, Single)
Create a flee movement.
Declaration
public KaijuFleeMovement(KaijuAgent agent, Component target, float distance = 20F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| Component | target | The component to flee from. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuFleeMovement(KaijuAgent, GameObject, Single, Single)
Create a flee movement.
Declaration
public KaijuFleeMovement(KaijuAgent agent, GameObject target, float distance = 20F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| GameObject | target | The GameObject to flee from. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuFleeMovement(KaijuAgent, Vector2, Single, Single)
Create a flee movement.
Declaration
public KaijuFleeMovement(KaijuAgent agent, Vector2 target, float distance = 20F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| Vector2 | target | The position to flee from. |
| System.Single | distance | The distance from the target to consider this movement done. |
| System.Single | weight | The weight of this KaijuMovement. |
KaijuFleeMovement(KaijuAgent, Vector3, Single, Single)
Create a flee movement.
Declaration
public KaijuFleeMovement(KaijuAgent agent, Vector3 target, float distance = 20F, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| Vector3 | target | The position to flee from. |
| 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 flee movement.
Declaration
public static KaijuFleeMovement Get(KaijuAgent agent, Component target, float distance = 20F, 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 flee be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuFleeMovement | Get a flee movement for the KaijuAgent. |
Get(KaijuAgent, GameObject, Single, Single)
Get a flee movement.
Declaration
public static KaijuFleeMovement Get(KaijuAgent agent, GameObject target, float distance = 20F, 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 flee be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuFleeMovement | Get a flee movement for the KaijuAgent. |
Get(KaijuAgent, Vector2, Single, Single)
Get a flee movement.
Declaration
public static KaijuFleeMovement Get(KaijuAgent agent, Vector2 target, float distance = 20F, 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 flee be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuFleeMovement | Get a KaijuWanderMovement for the KaijuAgent. |
Get(KaijuAgent, Vector3, Single, Single)
Get a flee movement.
Declaration
public static KaijuFleeMovement Get(KaijuAgent agent, Vector3 target, float distance = 20F, 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 flee be considered successful. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuFleeMovement | Get a flee movement for the KaijuAgent. |