private void PerformObjectLogic(Gaze_GazeEventArgs _e)
        {
            // if sender is the gazable collider GameObject specified in the InteractiveObject Gaze field
            if (_e.Sender != null && gazeCollider != null)
            {
                if (constraints == Gaze_GazeConstraints.ANY_OBJECT || Utilities.FindGameObjectInChilds(gazeCollider.gameObject.transform.parent.gameObject, ((GameObject)_e.Sender)))
                {
                    if (constraints == Gaze_GazeConstraints.ANY_OBJECT)
                    {
                        Debug.LogError("PerformObjectLogic::STEP 3::ANY OBJECT");
                    }
                    else
                    {
                        Debug.LogError("PerformObjectLogic::STEP 3::OBJECT[" + gazeCollider.gameObject.name + "]");
                    }

                    // check if gaze is set to IN or OUT, and set IsValid accordingly
                    if (gazeConditionsScript.gazeIn)
                    {
                        IsValid          = _e.IsGazed;
                        validToEditorGUI = IsValid;
                        Debug.LogError("PerformObjectLogic::STEP 4::GAZE IN++");
                    }
                    else
                    {
                        IsValid          = !_e.IsGazed;
                        validToEditorGUI = IsValid;
                        Debug.LogError("PerformObjectLogic::STEP 4::GAZE OUT--");
                    }
                }
            }
        }
 private void PerformPlaneLogic(Gaze_GazeEventArgs _e)
 {
     if (gazeConditionsScript.gazeIn)
     {
         IsValid          = _e.IsGazed;
         validToEditorGUI = IsValid;
     }
     else
     {
         IsValid          = !_e.IsGazed;
         validToEditorGUI = IsValid;
     }
 }
 private void OnGazeEvent(Gaze_GazeEventArgs _e)
 {
     if (_e.TargetType == Gaze_GazeConstraints.PLANE && constraints == Gaze_GazeConstraints.PLANE)
     {
         PerformPlaneLogic(_e);
     }
     else if (_e.TargetType == Gaze_GazeConstraints.IMAGE)
     {
         PerformImageLogic(_e);
     }
     else if (_e.TargetType == Gaze_GazeConstraints.OBJECT)
     {
         PerformObjectLogic(_e);
     }
 }
Esempio n. 4
0
 private void onGazeEvent(Gaze_GazeEventArgs e)
 {
     // if sender is the gazable collider GameObject
     if (e.Sender != null && (GameObject)e.Sender == gazable.gazeColliderIO.gameObject)
     {
         // if zoom is enabled
         if (zoom)
         {
             // if we are in a zoom status
             if (zoomOnTriggerState[gazable.triggerStateIndex])
             {
                 // notify manager
                 Gaze_EventManager.FireZoomEvent(new Gaze_ZoomEventArgs(gameObject, gazable.gazeColliderIO.GetComponentInChildren <Gaze_Gaze>().GetComponent <Collider>(), zoomFovFactor, zoomSpeedFactor, (Gaze_DezoomMode)dezoomModeIndex, dezoomSpeedFactor, zoomCurve));
             }
         }
     }
 }
 private void PerformImageLogic(Gaze_GazeEventArgs _e)
 {
     // if sender is the gazable collider GameObject specified in the InteractiveObject Gaze field
     if (_e.Sender != null && gazeCollider != null)
     {
         if (constraints == Gaze_GazeConstraints.IMAGE && ((string)_e.Sender == gazeConditionsScript.arAnchorImage.name))
         {
             // check if gaze is set to IN or OUT, and set IsValid accordingly
             if (gazeConditionsScript.gazeIn)
             {
                 IsValid          = _e.IsGazed;
                 validToEditorGUI = IsValid;
             }
             else
             {
                 IsValid          = !_e.IsGazed;
                 validToEditorGUI = IsValid;
             }
         }
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Method called when a gaze events occur.
 /// </summary>
 /// <param name="e">event arguments</param>
 protected abstract void onGazeEvent(Gaze_GazeEventArgs e);