Exemplo n.º 1
0
 public float GetNormalizedScoreForResponder(FrameData frameData, PerformanceResponder performanceResponder, float maxNormalizedScore)
 {
     if (performanceResponder.GetPerformanceResponderType() != getExpectedResponseType())
     {
         throw new ArgumentException(string.Concat("Expected PerformanceResponseType of ", getExpectedResponseType(), ", but got PerformanceResponder of type ", performanceResponder.GetPerformanceResponderType()));
     }
     return(evaluateScore(frameData, performanceResponder, maxNormalizedScore));
 }
Exemplo n.º 2
0
        public void RemoveResponder(PerformanceResponder performanceResponder)
        {
            PerformanceResponderType performanceResponderType = performanceResponder.GetPerformanceResponderType();

            if (performanceResponderTypeToResponders.ContainsKey(performanceResponderType))
            {
                performanceResponderTypeToResponders[performanceResponderType].Remove(performanceResponder);
            }
        }
Exemplo n.º 3
0
        public float AddResponder(PerformanceResponder performanceResponder)
        {
            PerformanceResponderType performanceResponderType = performanceResponder.GetPerformanceResponderType();

            if (!performanceResponderTypeToResponders.ContainsKey(performanceResponderType))
            {
                List <PerformanceResponder> list = new List <PerformanceResponder>();
                list.Add(performanceResponder);
                performanceResponderTypeToResponders.Add(performanceResponderType, list);
            }
            else if (!performanceResponderTypeToResponders[performanceResponderType].Contains(performanceResponder))
            {
                performanceResponderTypeToResponders[performanceResponderType].Add(performanceResponder);
            }
            return(1f);
        }
Exemplo n.º 4
0
        protected override float evaluateScore(FrameData frameData, PerformanceResponder performanceResponder, float maxNormalizedScore)
        {
            float num       = 0f;
            float magnitude = (Camera.main.transform.position - performanceResponder.TransformRef.position).magnitude;

            if (magnitude <= 5f)
            {
                return(maxNormalizedScore);
            }
            if (magnitude >= 10f)
            {
                return(0.5f);
            }
            float num2 = maxNormalizedScore - 0.5f;
            float num3 = (magnitude - 5f) / 5f;

            return(maxNormalizedScore - num3 * num2);
        }
Exemplo n.º 5
0
 protected abstract float evaluateScore(FrameData frameData, PerformanceResponder performanceResponder, float maxNormalizedScore);