Class KaijuAgentsDirection
Extension methods to get the direction along the X and Z axes from one position to another. All three-dimensional vectors will be flattened via methods in KaijuAgentsFlatten.
Inheritance
Namespace: KaijuSolutions.Agents.Extensions
Syntax
public static class KaijuAgentsDirection
Methods
Direction(Component, Component)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Component self, Component other)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | self | This position. |
| Component | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Component, GameObject)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Component self, GameObject other)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | self | This position. |
| GameObject | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Component, Transform)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Component self, Transform other)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | self | This position. |
| Transform | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Component, Vector2)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Component self, Vector2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | self | This position. |
| Vector2 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Component, Vector3)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Component self, Vector3 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | self | This position. |
| Vector3 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(GameObject, Component)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this GameObject self, Component other)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | self | This position. |
| Component | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(GameObject, GameObject)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this GameObject self, GameObject other)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | self | This position. |
| GameObject | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(GameObject, Transform)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this GameObject self, Transform other)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | self | This position. |
| Transform | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(GameObject, Vector2)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this GameObject self, Vector2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | self | This position. |
| Vector2 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(GameObject, Vector3)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this GameObject self, Vector3 other)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | self | This position. |
| Vector3 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Transform, Component)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Transform self, Component other)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | self | This position. |
| Component | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Transform, GameObject)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Transform self, GameObject other)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | self | This position. |
| GameObject | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Transform, Transform)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Transform self, Transform other)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | self | This position. |
| Transform | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Transform, Vector2)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Transform self, Vector2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | self | This position. |
| Vector2 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Transform, Vector3)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Transform self, Vector3 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | self | This position. |
| Vector3 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector2, Component)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector2 self, Component other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | self | This position. |
| Component | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector2, GameObject)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector2 self, GameObject other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | self | This position. |
| GameObject | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector2, Transform)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector2 self, Transform other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | self | This position. |
| Transform | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector2, Vector2)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector2 self, Vector2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | self | This position. |
| Vector2 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector2, Vector3)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector2 self, Vector3 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | self | This position. |
| Vector3 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector3, Component)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector3 self, Component other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | self | This position. |
| Component | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector3, GameObject)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector3 self, GameObject other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | self | This position. |
| GameObject | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector3, Transform)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector3 self, Transform other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | self | This position. |
| Transform | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector3, Vector2)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector3 self, Vector2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | self | This position. |
| Vector2 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |
Direction(Vector3, Vector3)
The direction from this position to another position.
Declaration
public static Vector2 Direction(this Vector3 self, Vector3 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | self | This position. |
| Vector3 | other | The other position. |
Returns
| Type | Description |
|---|---|
| Vector2 | The direction from this position to another position. |