コード例 #1
0
ファイル: RandomObject.cs プロジェクト: loickobes/Coolhobo-AR
    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);
            }
        }
    }
コード例 #2
0
 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();
     }
 }