public FloatSetting(float value, FieldInfo field, string group)
     : base(field, SettingType.Float, group)
 {
     Value = value;
     MinValueAttribute.GetMinValue(field, ref MinValue);
     MaxValueAttribute.GetMaxValue(field, ref MaxValue);
     StepSizeAttribute.GetStepSize(field, ref StepSize);
     ConvertMode     = ConversionModeAttribute.GetConversionMode(field);
     ConversionScale = ConversionScaleAttribute.GetConversionScale(field);
 }
Пример #2
0
        public static ConversionMode GetConversionMode(FieldInfo field)
        {
            ConversionModeAttribute attr = field.GetCustomAttribute <ConversionModeAttribute>();

            if (attr != null)
            {
                return(attr.Mode);
            }
            else
            {
                return(ConversionMode.None);
            }
        }