Example #1
0
        private void Update()
        {
            if (MLEyes.IsStarted && !float.IsNaN(MLEyes.FixationPoint.x))
            {
                EyeGaze.position = MLEyes.FixationPoint;
            }

            var raySource = MLEyes.IsStarted
                ? (MLEyes.LeftEye.Center + MLEyes.RightEye.Center) / 2
                : Vector3.zero + new Vector3(0, 0.1f, 0);
            var rayDir = EyeGaze.position - raySource;

            EyeGaze.LookAt(raySource);
            _gazeRay.SetPositions(new[] { raySource, EyeGaze.position });

            RaycastHit hit;

            if (Physics.Raycast(raySource, rayDir, out hit, 10))
            {
                if (hit.collider.CompareTag("Bubble"))
                {
                    _telekinesis.GazedAtBubble(hit.collider.gameObject);
                }
            }
        }
Example #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Finger"))
     {
         Pop();
     }
     else if (other.gameObject.CompareTag("Gaze"))
     {
         Telekinesis.GazedAtBubble(gameObject);
     }
 }