public MagicElementAttributeSlider(string Name, double DefaultValue, double MinValue, double MaxValue, OnSliderChange DelegateOnSliderChange) : base(Name, 200, 30) { Value = DefaultValue; this.MinValue = MinValue; this.MaxValue = MaxValue; this.DelegateOnSliderChange = DelegateOnSliderChange; InitSliderX(); }
static public void SliderValue(Transform t, int m) { if (t != null) { Slider s = t.GetComponent <Slider>(); OnSliderChange onChange = t.GetComponent <OnSliderChange>(); if (onChange) { onChange.setValue = true; } s.value = m; if (onChange) { onChange.setValue = false; } } }
public void UpdateSlider(float newValue) { slider.value = newValue; OnSliderChange?.Invoke(); }