Hello Intellify.
This code show whatever you want when target is lost or found.
// Assign to ImageTargetController to debug //
public ImageTargetController controllerName;
public ImageTargetController controllerName2;
// Assign to ImageTargetController to debug //
private void Awake()
{
AddTargetControllerEvents(controllerName);
AddTargetControllerEvents(controllerName2);
}
private void AddTargetControllerEvents(ImageTargetController controller)
{
if (!controller)
{
return;
}
controller.TargetFound += () =>
{
Debug.LogFormat("Found target {{id = {0}, name = {1}}}", controller.Target.runtimeID(), controller.Target.name());
};
controller.TargetLost += () =>
{
Debug.LogFormat("Lost target {{id = {0}, name = {1}}}", controller.Target.runtimeID(), controller.Target.name());
};
}