Ejemplo n.º 1
0
        private bool IsGazeDataNeedingUpdateWhenNoHit()
        {
            var isNeeded = _LastHandler != null;

            _LastHandler = null;
            return(isNeeded);
        }
Ejemplo n.º 2
0
 private void SetCurrentToHitInfo(GameObject target, IGazeEventHandler handler)
 {
     _Current.GazeTarget  = target;
     _Current.GazeHandler = handler;
     _Current.EventKind   = GazeEventKind.NoEvent;
     _LastHandler         = handler;
 }
Ejemplo n.º 3
0
        private bool IsGazeDataNeedingUpdate(RaycastHit hit)
        {
            IGazeEventHandler handler = hit.collider.GetComponent <IGazeEventHandler>();

            if (handler != null)
            {
                SetCurrentToHitInfo(hit.collider.gameObject, handler);
                return(true);
            }
            else
            {
                if (IsGazeDataNeedingUpdateWhenNoHit())
                {
                    SetCurrentToEmtpy(hit.collider.gameObject);
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 4
0
        private void BroadCast(IGazeEventHandler handler, GazeData data)
        {
            switch (data.EventKind)
            {
            case GazeEventKind.NoEvent: break;

            case GazeEventKind.OnGazeClick: handler.OnGazeClick(data); break;

            case GazeEventKind.OnGazeEnter: handler.OnGazeEnter(data); break;

            case GazeEventKind.OnGazeExit: handler.OnGazeLeave(data); break;

            case GazeEventKind.OnGazeStay: handler.OnGazeContinue(data); break;

            default:
                Logging.Log <SimpleGazeEventBroadcaster>("EventKind {0} was not handled", data.EventKind);
                break;
            }
        }