Code Reference‎ > ‎


class TargetTracker MonoBehaviour

Members (Delegates)
The following functions are used to add, set (replace) or remove a delegate for an event. The function being passed as 'del' need only match the signature of the delegate as shown. The function name can be anything you want.

OnPostSort(TargetList targets)
Runs just before the target list is returned allowing for any custom modifications. The TargetList is passed by reference so no return value is needed. Just modify the list.

void AddPostSortDelegate(OnPostSortDelegate del)
void SetPostSortDelegate(OnPostSortDelegate del)
void RemovePostSortDelegate(OnPostSortDelegate del)

Class Members


Set to get more feedback  about what is happening in this TargetTracker and perimeter. This includes message logging as well as gizmo lines if applicable. See the TargetPRO namespace for enum options.

int numberOfTargets

The number of targets to return. Set to -1 to return all targets


The style of sorting for the perimeter to use

enum SORTING_STYLES options include:
  • None - Also good for area-of-effects where no sort is needed
  • Nearest - Closest to the perimter's center (localPostion)
  • Farthest - Farthest from the perimter's center (localPostion)
  • NearestToDestination - Nearest to a destination along waypoints
  • FarthestFromDestination - Farthest from a destination along waypoints
  • MostPowerful - Most powerful based on a iTargetable parameter
  • LeastPowerful - Least powerful based on a iTargetable parameter

LayerMask targetLayers

The layers in which the perimeter is allowed to find targets.

TargetList targets

A list of sorted targets. The contents depend on numberOfTargets requested (-1 for all targets in the perimeter), and the sorting style used.