Skip to content

Instantly share code, notes, and snippets.

@burrussmp
Last active April 26, 2020 21:19
Show Gist options
  • Save burrussmp/8962d1c114b268f0fde31a48602bef4a to your computer and use it in GitHub Desktop.
Save burrussmp/8962d1c114b268f0fde31a48602bef4a to your computer and use it in GitHub Desktop.
Vuforia handle detection of image target
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
Debug.Log("Detected");
StartCoroutine(GetData());
Debug.Log("Got Data");
StartCoroutine(CreateMesh());
Debug.Log("Got Mesh");
StartCoroutine(UpdatePos());
Debug.Log("Updated Position");
detected = true;
} else {
detected = false;
foreach (Transform child in gameObject.transform) {
GameObject.Destroy(child.gameObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment