Пример #1
0
        public float ApplyTo(StatusKeeper keeper, double deltaTime)
        {
            Symptom symptom = null;

            if (mSymptomLookup.TryGetValue(keeper.Name, out symptom))                   //if it's active...
            {
                if (symptom.IsActive(TimeSoFar))
                {
                    //apply to the actual value not the normalized value
                    float currentValue = keeper.Value;
                    //get the ACTUAL seek value as it applies to this keeper's seek value type
                    float seekValue = StatusKeeper.GetSeekValue(keeper.ActiveState.SeekType, symptom.SeekType, symptom.SeekValue);
                    //apply the value to the current value
                    return(Mathf.Lerp(currentValue, symptom.SeekValue, (float)(symptom.SeekSpeed * deltaTime)));
                }
                else                            //if it's not active just return the untouched value
                {
                    return(keeper.Value);
                }
            }
            else
            {
                return(keeper.Value);
            }
        }
Пример #2
0
 public bool HasSymptomFor(string statusKeeperName, out Symptom symptom)
 {
     return(mSymptomLookup.TryGetValue(statusKeeperName, out symptom));
 }