public FocusedObject GetFocusedObject(IEnumerable <GazePoint> lastGazePoints, Camera camera)
        {
            var gazePoints = new List <GazePoint>();

            /*Note: Do not use LINQ here - too inefficient to be called every update.*/
            foreach (var gazePoint in lastGazePoints)
            {
                if (gazePoint.IsValid)
                {
                    gazePoints.Add(gazePoint);
                }
            }

            foreach (var gazePoint in gazePoints)
            {
                var objectsInGaze = FindObjectsInGaze(gazePoint.Screen, camera);
                UpdateFocusConfidenceScore(objectsInGaze);
            }

            var focusChallenger = FindFocusChallenger();

            if (focusChallenger.GetScore() > _focusedObject.GetScore() + Threshold)
            {
                _focusedObject = focusChallenger;
            }

            return(FocusedGameObject);
        }
 public void RemoveObject(GameObject gameObject)
 {
     _scoredObjects.Remove(gameObject.GetInstanceID());
     if (_focusedObject.GameObject.GetInstanceID() == gameObject.GetInstanceID())
     {
         _focusedObject = ScoredObject.Empty();
     }
 }