public void OnTrackableStateChanged( TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) { if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { int rndObj; do { rndObj = Random.Range(0, models.Length); } while (previousModel == rndObj); stats.FoundTarget(models [rndObj].name); models [rndObj].SetActive(true); previousModel = rndObj; } else { stats.LostTarget(); foreach (GameObject obj in models) { obj.SetActive(false); } } }
public void OnTrackableStateChanged( TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) { if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { voucher.foundTarget(this.gameObject.name); stats.FoundTarget(this.gameObject.name); Debug.Log("Found Target: " + this.gameObject.name); } else { stats.LostTarget(); } }