示例#1
0
 public FloatListElement(string text, Color color, List <float> options, float startValue, Action <float> onValueChanged, string units = "", string subtitleText = "") : base(text, color, subtitleText)
 {
     this.options = options;
     if (options.Contains(startValue))
     {
         this.value = startValue;
     }
     else
     {
         this.value = options[0];
     }
     this.onValueChanged = new FloatListElement.OnValueChanged(onValueChanged.Invoke);
     this.units          = units;
 }
示例#2
0
 public override void OnLeft()
 {
     this.currentOption--;
     if (this.currentOption < 0)
     {
         this.currentOption = this.options.Count - 1;
     }
     this.value = this.options[this.currentOption];
     FloatListElement.OnValueChanged onValueChanged = this.onValueChanged;
     if (onValueChanged != null)
     {
         onValueChanged(this.value);
     }
     this.Render(base.GetTextObject());
 }