void UpdateReticle(GameObject previousGazedObject)
    {
        if (gazePointer == null)
        {
            return;
        }

        Camera     camera               = pointerData.enterEventCamera; // Get the camera
        GameObject gazeObject           = GetCurrentGameObject();       // Get the gaze target
        Vector3    intersectionPosition = GetIntersectionPosition();
        bool       isInteractive        = pointerData.pointerPress != null ||
                                          ExecuteEvents.GetEventHandler <IPointerClickHandler>(gazeObject) != null;

        if (gazeObject == previousGazedObject)
        {
            if (gazeObject != null)
            {
                gazePointer.OnGazeStay(camera, gazeObject, intersectionPosition, isInteractive);
            }
        }
        else
        {
            if (previousGazedObject != null)
            {
                gazePointer.OnGazeExit(camera, previousGazedObject);
            }

            if (gazeObject != null)
            {
                gazePointer.OnGazeStart(camera, gazeObject, intersectionPosition, isInteractive);
            }
        }
    }
Beispiel #2
0
 void OnDisable()
 {
     // Is there a current target?
     if (currentTarget != null)
     {
         currentTarget.OnGazeExit();
     }
     // Tell pointer to exit target.
     if (pointer != null)
     {
         // Is there a pending trigger?
         if (isTriggered)
         {
             pointer.OnGazeTriggerEnd(cam);
         }
         if (currentGazeObject != null)
         {
             pointer.OnGazeExit(cam, currentGazeObject);
         }
         pointer.OnGazeDisabled();
     }
     currentGazeObject = null;
     currentTarget     = null;
     isTriggered       = false;
 }
 public void OnGazeExit(Camera camera, GameObject targetObject)
 {
     GazePointer.OnGazeExit(camera, targetObject);
     Target = null;
 }