Class KaijuMovement
Base movement class.
Inheritance
Namespace: KaijuSolutions.Agents.Movement
Syntax
public abstract class KaijuMovement
Constructors
KaijuMovement(KaijuAgent, Single)
Create The movement.
Declaration
public KaijuMovement(KaijuAgent agent, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| System.Single | weight | The weight of this movement. |
Fields
Agent
The KaijuAgent the movement is assigned to.
Declaration
public KaijuAgent Agent
Field Value
| Type | Description |
|---|---|
| KaijuAgent |
DefaultWeight
The default Weight for movement.
Declaration
public const float DefaultWeight = 1F
Field Value
| Type | Description |
|---|---|
| System.Single |
Properties
Weight
The weight of this movement.
Declaration
public float Weight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Methods
Done()
Determine if the movement is done or not.
Declaration
public virtual bool Done()
Returns
| Type | Description |
|---|---|
| System.Boolean | If the movement is done or not. |
EditorRenderVisualizations(Vector3)
Render the visualization of the movement. The position of the Agent.
Declaration
protected virtual void EditorRenderVisualizations(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position |
EditorVisualizationColor()
Get the color for visualizations.
Declaration
protected virtual Color EditorVisualizationColor()
Returns
| Type | Description |
|---|---|
| Color | The color for visualizations |
EditorVisualize(Vector3)
Allow for visualizing in the editor. The position of the Agent.
Declaration
public void EditorVisualize(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position |
Initialize(KaijuAgent, Single)
Initialize The movement.
Declaration
protected void Initialize(KaijuAgent agent, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| System.Single | weight | The weight of this movement. |
Move(Vector2, Single)
Get the movement.
Declaration
public abstract Vector2 Move(Vector2 position, float delta)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position of the Agent. |
| System.Single | delta | The time step. |
Returns
| Type | Description |
|---|---|
| Vector2 | The calculated move vector. |
Performed()
Invoke performed callbacks.
Declaration
public void Performed()
Reset()
Perform any needed reset operations.
Declaration
protected virtual void Reset()
Return()
Return this movement.
Declaration
public void Return()
Setup()
Handle any additional setup.
Declaration
protected virtual void Setup()
Started()
Invoke started callbacks.
Declaration
public void Started()
Stopped()
Invoke stopped callbacks.
Declaration
public void Stopped()
Events
OnPerformed
Callback for this movement being performed.
Declaration
public event KaijuAction OnPerformed
Event Type
| Type | Description |
|---|---|
| KaijuAction |
OnPerformedGlobal
Global callback for this movement being performed.
Declaration
public static event KaijuMovementAction OnPerformedGlobal
Event Type
| Type | Description |
|---|---|
| KaijuMovementAction |
OnStarted
Callback for this movement starting.
Declaration
public event KaijuAction OnStarted
Event Type
| Type | Description |
|---|---|
| KaijuAction |
OnStartedGlobal
Global callback for this movement starting.
Declaration
public static event KaijuMovementAction OnStartedGlobal
Event Type
| Type | Description |
|---|---|
| KaijuMovementAction |
OnStopped
Callback for this movement stopping.
Declaration
public event KaijuAction OnStopped
Event Type
| Type | Description |
|---|---|
| KaijuAction |
OnStoppedGlobal
Global callback for this movement stopping.
Declaration
public static event KaijuMovementAction OnStoppedGlobal
Event Type
| Type | Description |
|---|---|
| KaijuMovementAction |
Operators
Implicit(KaijuMovement to GameObject)
Implicit conversion to a GameObject from the assigned Agent.
Declaration
public static implicit operator GameObject(KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| GameObject | The GameObject of the assigned Agent. |
Implicit(KaijuMovement to KaijuAgent)
Implicit conversion to an KaijuAgent from the assigned Agent.
Declaration
public static implicit operator KaijuAgent(KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| KaijuAgent | The KaijuAgent. |
Implicit(KaijuMovement to Boolean)
Implicit conversion to a Boolean to see if the Agent is assigned.
Declaration
public static implicit operator bool (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the Agent is assigned. |
Implicit(KaijuMovement to Double)
Implicit conversion to a double from the Weight.
Declaration
public static implicit operator double (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Double | The Weight. |
Implicit(KaijuMovement to Nullable<Boolean>)
Implicit conversion to a nullable Boolean to see if the Agent is assigned.
Declaration
public static implicit operator bool? (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> | If the Agent is assigned. |
Implicit(KaijuMovement to Nullable<Double>)
Implicit conversion to a nullable double from the Weight.
Declaration
public static implicit operator double? (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The Weight. |
Implicit(KaijuMovement to Nullable<Single>)
Implicit conversion to a nullable float from the Weight.
Declaration
public static implicit operator float? (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Single> | The Weight. |
Implicit(KaijuMovement to Nullable<Vector2>)
Declaration
public static implicit operator Vector2? (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Nullable<Vector2> |
Implicit(KaijuMovement to Nullable<Vector3>)
Declaration
public static implicit operator Vector3? (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Nullable<Vector3> |
Implicit(KaijuMovement to Single)
Implicit conversion to a float from the Weight.
Declaration
public static implicit operator float (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.Single | The Weight. |
Implicit(KaijuMovement to String)
Implicit conversion to a string.
Declaration
public static implicit operator string (KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| System.String | The string from the KaijuSolutions.Agents.Movement.KaijuMovement.ToString method. |
Implicit(KaijuMovement to Transform)
Declaration
public static implicit operator Transform(KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| Transform |
Implicit(KaijuMovement to Vector2)
Declaration
public static implicit operator Vector2(KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| Vector2 |
Implicit(KaijuMovement to Vector3)
Declaration
public static implicit operator Vector3(KaijuMovement m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuMovement | m | The movement. |
Returns
| Type | Description |
|---|---|
| Vector3 |