Code Reference‎ > ‎

TargetProMessenger

public class TargetProMessenger: MonoBehaviour

Examples are in UnityScript (a.k.a. JaveScript)

Message (receiving function) arguments are optional, but available as shown in the the docs for each TargetPRO component delegates. For example, the Targetable's OnDetected delegate shows a TargetTracker argument. Using this example, either of these functions would be triggered:

function Targetable_OnDetected()
{
    // ...
}

function Targetable_OnDetected(source : TargetTracker)
{
    // ...
}


Functions which offer more than one argument are packed in to a single struct to be passed. For example, the Targetable OnHit event offers both:  HitEffectList effects and Target target. TheTargetPROMessenger.MessageData_TargetableOnHit will be passed with both arguments, like this:

function Targetable_OnHit(data :  MessageData_TargetableOnHit)
{
    Debug.Log(data.target.gameObject);
    Debug.Log(data.target.targetable);
    Debug.Log(data.target.targetTracker);
    Debug.Log(data.effects[0].name)
    Debug.Log(data.effects[0].value)
    Debug.Log(data.effects[0].duration)
}


Members (Other)

This component is designed to be used through the inspector rather than as an API.

DEBUG_LEVELS debugLevel

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.