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); } } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Finger")) { Pop(); } else if (other.gameObject.CompareTag("Gaze")) { Telekinesis.GazedAtBubble(gameObject); } }