using UnityEngine;
using Vuforia;

public class TargetManager : DefaultObserverEventHandler
{
    public GameObject myModelPrefab;

    GameObject mMyModelObject;

    protected override void OnTrackingFound()
    {
        Debug.Log("Target Found");

        // Instantiate the model prefab only if it hasn't been instantiated yet
        if (mMyModelObject == null) 
            InstantiatePrefab();

        base.OnTrackingFound();
    }

    protected override void OnTrackingLost()
    {
        Debug.Log("Target Lost");
        
        base.OnTrackingLost();
    }

    void InstantiatePrefab()
    {
        Debug.Log("Instantiate...");
    }
}