Vuforia - Disable/Enable Game Object Mesh Renderer On Button Touch Event

Is there any way to disable or enable the game object Mesh Renderer on button press in Vuforia? I knew it is easier to do in unity.

In Vuforia, OnTrackingLost() function handles this. But how do I reference the particular game object and turn on the renderer on and off using button click?

Any help would be appreciated. Thanks.

Just like you would do for a normal object. As long as you detect the event (OnTrackingLost) you can spread the event to any listener and in your case you would have your GameObject that waits for the event to be triggered:

public class TargetTracker : MonoBehaviour, ITrackingEventHandler
{
    public event Action OnTrackingFound = ()=>{};	
    public event Action OnTrackingLost = ()=>{};

    public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) 
    {
       if(newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || 
                  newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED){
             OnTrackingFound();	
       } else{
             OnTrackingLost();
       }
   }
 }

Then your object listens like this:

public class ObjectTrackListener:MonoBehaviour{
    private   TargetTracker tt = null;
    void Start(){
          tt = GameObect.Find("Tracker").GetComponent<TargetTracker>();
          tt.OnTrackingFound += TrackingFound;
          tt.OnTrackingLost += TrackingLost;
    }
    void OnDestroy(){
         tt.OnTrackingFound -= TrackingFOund;
         tt.OnTrackingLost -= TrackingLost;
    }
    private void TrackingFound(){
          gameObject.SetActive(true);
    }
    private void TrackingFound(){
         gameObject.SetActive(false);
    }
}

In this case, it will deactivate the object but you get teh idea you can do whatever you wish in there, like disabling renderer.