private void ClearFocusedObjectIfOld()
 {
     if (!_focusedObject.IsRecentlyHit())
     {
         _focusedObject = ScoredObject.Empty();
     }
 }
 public void RemoveObject(GameObject gameObject)
 {
     _scoredObjects.Remove(gameObject.GetInstanceID());
     if (_focusedObject.GameObject.GetInstanceID() ==
         gameObject.GetInstanceID())
     {
         _focusedObject = ScoredObject.Empty();
     }
 }
        private ScoredObject FindFocusChallenger()
        {
            var topFocusChallenger = ScoredObject.Empty();
            var topScore           = 0.0f;

            foreach (var key in _scoredObjects.Keys)
            {
                var scoredObject = _scoredObjects[key];

                var score = scoredObject.GetScore(
                    Time.unscaledTime - LoseGazeDwellTime,
                    Time.unscaledTime - GainGazeDwellTime);

                if (score > topScore)
                {
                    topScore           = score;
                    topFocusChallenger = scoredObject;
                }
            }

            return(topFocusChallenger);
        }
 public void Reset()
 {
     _scoredObjects.Clear();
     _focusedObject = ScoredObject.Empty();
 }