public override void OnSetAttribute() { attribute = Attribute <SliderInputAttribute>(); if (attribute.IsAutoRange) { setValue(attribute.Default, attribute.Range, attribute.IsInt); } else { setValue(attribute.Default, attribute.Min, attribute.Max, attribute.IsInt); } }
public override void OnSetAttribute() { attribute = Attribute <SliderInputAttribute>(); bInt = attribute.IsInt; ScaleRange = bInt ? 1.0f : 100.0f; if (attribute.IsAutoRange) { Range = (int)(attribute.Range * ScaleRange); } else { Range = (int)((attribute.Max - attribute.Min) * ScaleRange); } trackBar1.Minimum = (int)(attribute.Min * ScaleRange); trackBar1.Maximum = (int)(attribute.Max * ScaleRange); setValue(attribute.Default * ScaleRange); }