예제 #1
0
 private void ClearFocusedObjectIfOld()
 {
     if (!_focusedObject.IsRecentlyHit())
     {
         _focusedObject = ScoredObject.Empty();
     }
 }
예제 #2
0
 public void RemoveObject(GameObject gameObject)
 {
     _scoredObjects.Remove(gameObject.GetInstanceID());
     if (_focusedObject.GameObject.GetInstanceID() == gameObject.GetInstanceID())
     {
         _focusedObject = ScoredObject.Empty();
     }
 }
예제 #3
0
        private ScoredObject FindFocusChallenger()
        {
            ScoredObject topFocusChallenger = ScoredObject.Empty();
            float        topScore           = 0.0f;

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

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

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

            return(topFocusChallenger);
        }
예제 #4
0
 public void Reset()
 {
     _scoredObjects.Clear();
     _focusedObject = ScoredObject.Empty();
 }