Class KaijuAgentsSortDistance
Extension methods for sorting objects by their distance to a given position along the X and Z axes. All three-dimensional vectors will be flattened via methods in KaijuAgentsFlatten.
Inheritance
Namespace: KaijuSolutions.Agents.Extensions
Syntax
public static class KaijuAgentsSortDistance
Methods
SortDistance(Component, GameObject[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, GameObject[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| GameObject[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, IEnumerable<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static GameObject[] SortDistance(this Component position, IEnumerable<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| GameObject[] | The sorted array. |
SortDistance(Component, IEnumerable<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Transform[] SortDistance(this Component position, IEnumerable<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Transform[] | The sorted array. |
SortDistance(Component, IEnumerable<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector2[] SortDistance(this Component position, IEnumerable<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Vector2[] | The sorted array. |
SortDistance(Component, IEnumerable<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector3[] SortDistance(this Component position, IEnumerable<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Vector3[] | The sorted array. |
SortDistance(Component, List<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, List<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.List<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, List<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, List<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.List<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, List<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, List<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, List<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, List<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, Transform[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, Transform[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| Transform[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, Vector2[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, Vector2[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| Vector2[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Component, Vector3[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Component position, Vector3[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| Vector3[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, GameObject[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, GameObject[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| GameObject[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, IEnumerable<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static GameObject[] SortDistance(this GameObject position, IEnumerable<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| GameObject[] | The sorted array. |
SortDistance(GameObject, IEnumerable<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Transform[] SortDistance(this GameObject position, IEnumerable<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Transform[] | The sorted array. |
SortDistance(GameObject, IEnumerable<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector2[] SortDistance(this GameObject position, IEnumerable<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Vector2[] | The sorted array. |
SortDistance(GameObject, IEnumerable<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector3[] SortDistance(this GameObject position, IEnumerable<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Vector3[] | The sorted array. |
SortDistance(GameObject, List<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, List<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.List<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, List<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, List<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.List<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, List<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, List<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, List<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, List<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, Transform[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, Transform[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| Transform[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, Vector2[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, Vector2[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| Vector2[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(GameObject, Vector3[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this GameObject position, Vector3[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| Vector3[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, GameObject[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, GameObject[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| GameObject[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, IEnumerable<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static GameObject[] SortDistance(this Transform position, IEnumerable<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| GameObject[] | The sorted array. |
SortDistance(Transform, IEnumerable<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Transform[] SortDistance(this Transform position, IEnumerable<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Transform[] | The sorted array. |
SortDistance(Transform, IEnumerable<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector2[] SortDistance(this Transform position, IEnumerable<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Vector2[] | The sorted array. |
SortDistance(Transform, IEnumerable<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector3[] SortDistance(this Transform position, IEnumerable<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| Vector3[] | The sorted array. |
SortDistance(Transform, List<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, List<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.List<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, List<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, List<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.List<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, List<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, List<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, List<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, List<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, Transform[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, Transform[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| Transform[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, Vector2[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, Vector2[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| Vector2[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Transform, Vector3[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Transform position, Vector3[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| Vector3[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
SortDistance(Vector2, GameObject[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, GameObject[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| GameObject[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, IEnumerable<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static GameObject[] SortDistance(this Vector2 position, IEnumerable<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| GameObject[] | The sorted array. |
SortDistance(Vector2, IEnumerable<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Transform[] SortDistance(this Vector2 position, IEnumerable<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| Transform[] | The sorted array. |
SortDistance(Vector2, IEnumerable<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector2[] SortDistance(this Vector2 position, IEnumerable<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| Vector2[] | The sorted array. |
SortDistance(Vector2, IEnumerable<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector3[] SortDistance(this Vector2 position, IEnumerable<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| Vector3[] | The sorted array. |
SortDistance(Vector2, List<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, List<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.List<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, List<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, List<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.List<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, List<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, List<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, List<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, List<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, Transform[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, Transform[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| Transform[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, Vector2[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, Vector2[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| Vector2[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector2, Vector3[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector2 position, Vector3[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| Vector3[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, GameObject[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, GameObject[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| GameObject[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, IEnumerable<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static GameObject[] SortDistance(this Vector3 position, IEnumerable<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| GameObject[] | The sorted array. |
SortDistance(Vector3, IEnumerable<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Transform[] SortDistance(this Vector3 position, IEnumerable<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| Transform[] | The sorted array. |
SortDistance(Vector3, IEnumerable<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector2[] SortDistance(this Vector3 position, IEnumerable<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| Vector2[] | The sorted array. |
SortDistance(Vector3, IEnumerable<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static Vector3[] SortDistance(this Vector3 position, IEnumerable<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| Vector3[] | The sorted array. |
SortDistance(Vector3, List<GameObject>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, List<GameObject> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.List<GameObject> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, List<Transform>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, List<Transform> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.List<Transform> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, List<Vector2>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, List<Vector2> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector2> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, List<Vector3>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, List<Vector3> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.List<Vector3> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, Transform[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, Transform[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| Transform[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, Vector2[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, Vector2[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| Vector2[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance(Vector3, Vector3[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance(this Vector3 position, Vector3[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| Vector3[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
SortDistance<T>(Component, T[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Component position, T[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| T[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Component, IEnumerable<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static T[] SortDistance<T>(this Component position, IEnumerable<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| T[] | The sorted array. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Component, List<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Component position, List<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Component | position | The position to sort in relation to. |
| System.Collections.Generic.List<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(GameObject, T[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this GameObject position, T[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| T[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(GameObject, IEnumerable<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static T[] SortDistance<T>(this GameObject position, IEnumerable<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| T[] | The sorted array. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(GameObject, List<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this GameObject position, List<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | position | The position to sort in relation to. |
| System.Collections.Generic.List<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Transform, T[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Transform position, T[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| T[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Transform, IEnumerable<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static T[] SortDistance<T>(this Transform position, IEnumerable<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Returns
| Type | Description |
|---|---|
| T[] | The sorted array. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Transform, List<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Transform position, List<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | position | The position to sort in relation to. |
| System.Collections.Generic.List<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. If NULL, the position's forward will be used. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Vector2, T[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Vector2 position, T[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| T[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Vector2, IEnumerable<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static T[] SortDistance<T>(this Vector2 position, IEnumerable<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| T[] | The sorted array. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Vector2, List<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Vector2 position, List<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position to sort in relation to. |
| System.Collections.Generic.List<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Vector3, T[], Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Vector3 position, T[] targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| T[] | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Vector3, IEnumerable<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position. This version will produce garbage, and it is recommended to use an inplace method instead.
Declaration
public static T[] SortDistance<T>(this Vector3 position, IEnumerable<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.IEnumerable<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Returns
| Type | Description |
|---|---|
| T[] | The sorted array. |
Type Parameters
| Name | Description |
|---|---|
| T |
SortDistance<T>(Vector3, List<T>, Boolean, Nullable<KaijuAngleSortMode>, Nullable<Vector2>)
Sort targets from a position.
Declaration
public static void SortDistance<T>(this Vector3 position, List<T> targets, bool farthest = false, KaijuAngleSortMode? mode = null, Vector2? forward = null)
where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to sort in relation to. |
| System.Collections.Generic.List<T> | targets | The targets to sort. |
| System.Boolean | farthest | If this should sort by farthest items first. |
| System.Nullable<KaijuAngleSortMode> | mode | How to break ties based on angle. |
| System.Nullable<Vector2> | forward | The forward direction to break ties on. |
Type Parameters
| Name | Description |
|---|---|
| T |