private void SliderValueChanged(float value) { if (OnSliderValueChanged != null) { OnSliderValueChanged.Invoke(value); } }
// Start is called before the first frame update void Start() { ChildSlider = transform.Find("Slider").transform.GetComponent <Slider>(); ChildSlider.minValue = sliderMin; ChildSlider.maxValue = sliderMax; ChildSlider.value = Value; ChildSlider.onValueChanged.AddListener(delegate { Value = ChildSlider.value; OnSliderValueChanged.Invoke(); }); valueInput = transform.Find("ValueInput").transform.GetComponent <InputField>(); valueInput.onValueChanged.AddListener(delegate { Value = float.Parse(valueInput.text); }); }
private void InvokeOnSliderValueChanged(float value) { OnSliderValueChanged?.Invoke(value); }