Example #1
0
        public float GetValueComponent(GameValueComponent checkType)
        {
            switch (checkType)
            {
            case GameValueComponent.Value:
                return(GetValue());

            case GameValueComponent.MinValue:
                return(GetMinValue());

            case GameValueComponent.MaxValue:
                return(GetMaxValue());

            case GameValueComponent.BaseValue:
                return(baseValue);

            case GameValueComponent.BaseMinValue:
                if (!valueCapped)
                {
                    Debug.LogWarning("Game Value '" + name + "' is uncapped, BaseMinValue will always return 0");
                    return(0);
                }
                return(capMin);

            case GameValueComponent.BaseMaxValue:
                if (!valueCapped)
                {
                    Debug.LogWarning("Game Value '" + name + "' is uncapped, BaseMaxValue will always return 0");
                    return(0);
                }

                return(capMax);
            }
            return(0);
        }
Example #2
0
 float GetValue(GameValueComponent checkType, float value, float min = float.MinValue, float max = float.MaxValue)
 {
     for (int i = 0; i < modifiers.Count; i++)
     {
         if (modifiers[i].modifyValueComponent == checkType)
         {
             value = modifiers[i].Modify(value);
         }
     }
     return(Mathf.Clamp(value, min, max));
 }
Example #3
0
        public float GetValue(GameValueComponent checkType)
        {
            switch (checkType)
            {
            case GameValueComponent.Value:
                return(GetValue());

            case GameValueComponent.MinValue:
                return(GetMinValue());

            case GameValueComponent.MaxValue:
                return(GetMaxValue());

            case GameValueComponent.BaseValue:
                return(baseValue);

            case GameValueComponent.BaseMinValue:
                return(baseMinValue);

            case GameValueComponent.BaseMaxValue:
                return(baseMaxValue);
            }
            return(0);
        }