private void ManageGazeInput() { //Get the Selected Object from the GazeController RaycastHit rayHit = SMIGazeController.Instance.GetRaycastHitFromGaze(); if (rayHit.collider != null) { //safe the GameObject in Focus GameObject objectInFocus = rayHit.collider.gameObject; //Select the GazeMonoBehaviour for further steps GazeMonobehaviour selection = objectInFocus.GetComponent <GazeMonobehaviour>(); //Do the next Steps if the GameObject has a GazeMonoComponent if (selection != null) { //Safe the old Selection if (oldSelection == null) { oldSelection = selection; } else if (selection != oldSelection) { oldSelection.OnObjectExit(); oldSelection = selection; } selection.OnElementHit(rayHit); } } else if (oldSelection != null) { oldSelection.OnObjectExit(); oldSelection = null; } }
private void ManageGazeInput() { //Get the Selected Object from the GazeController RaycastHit rayHit = SMIGazeController.Instance.GetRaycastHitFromGaze(); if (rayHit.collider != null) { //safe the GameObject in Focus GameObject objectInFocus = rayHit.collider.gameObject; //Select the GazeMonoBehaviour for further steps GazeMonobehaviour selection = objectInFocus.GetComponent<GazeMonobehaviour>(); //Do the next Steps if the GameObject has a GazeMonoComponent if (selection != null) { //Safe the old Selection if (oldSelection == null) { oldSelection = selection; } else if (selection != oldSelection) { oldSelection.OnObjectExit(); oldSelection = selection; } selection.OnElementHit(rayHit); } } else if (oldSelection != null) { oldSelection.OnObjectExit(); oldSelection = null; } }