using System; using wf.ui; namespace config.ui { public class IntegerSlider : NGUISlider { protected int srcValue { get { return (this.onGetValue == null) ? 0 : this.onGetValue(); } set { if (this.onSetValue != null) { this.onSetValue(value); } } } public override float srcValueToSliderValue { get { return (float)Math.Round((double)((float)this.srcValue / 100f), 2, MidpointRounding.AwayFromZero); } } public override int sliderValueToSrcValue { get { return (int)Math.Ceiling((double)(this.slider.value * 100f)); } } protected override void OnChangeSliderValue() { this.srcValue = this.sliderValueToSrcValue; } public Func onGetValue; public Action onSetValue; } }