Code Reference‎ > ‎


class DetonatorTargetTracker

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.

OnDetonationDelegate(TargetList targets)
Runs when this detonator is first triggered

void AddOnDetonationDelegate(OnDetonationDelegate del)
void SetOnDetonationDelegate(OnDetonationDelegate del)
void RemoveOnDetonationDelegate(OnDetonationDelegate del)

OnDetonatingUpdateDelegate(float progress)
Runs every frame

void AddOnDetonatingUpdateDelegate(OnDetonatingUpdateDelegate del)
void SetOnDetonatingUpdateDelegate(OnDetonatingUpdateDelegate del)
void RemoveDetonatingUpdateDelegate(OnDetonatingUpdateDelegate del)

Class Members

list<HitEffectList> effectsOnTarget

A list of HitEffect structs which can be used to determine how this FireController can affect a target.

float duration

This is how long, in seconds, it will take for the detonator to grow to the Max Range size.

Vector3 maxRange

This is the final size the detonator will grow to. The values used from the vector x, y, or z  will change depending on the detonation shape.

Class Members (Inherited from TargetTracker)


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.

bool drawGizmo

Turn the editor-only display gizmo on or off

Color gizmoColor

The color of the gizmo displayed in the Unity Editor (does not render)

Perimeter perimeter

Access to the perimeter component/list. This is rarely needed, if ever, but can be handy if you need direct access to the full list of items via perimeter.targets (which is not  the same TargetTracker's target list, which is affects by the options used). This might be useful to get access to the runtime-generated perimeter gameObject, but again, we don't think this is ever needed but is included for completeness. The TargetTracker controls the perimeter for you.


The shape of the perimeter used to detect targets in range

enum PERIMETER_SHAPES options include:
  • Capsule
  • Boxe
  • Spheree

Vector3 perimeterPositionOffset

An optional position offset for the perimeter.  For example, if you have an object resting on the ground which has a range of 4, a position offset of Vector3(0, 4, 0) will place your perimeter so it is  also sitting on the ground

Vector3 perimeterRotationOffset

An optional rotational offset for the perimeter.

int perimeterLayer

The layer to put the perimeter in when it is generated at run-time. 0 is the default layer.

Vector3 range

The range in which targets will be found. The size from the center to the edge of the perimeter in x, y and z for any shape. Depending on the shape some values may be ignored. E.g. Spheres only use X for radius

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 userd.

Transform xform

A cached reference to the Transform of this component's GameObject.