using System; using config.ui; using UnityEngine; public class ConfigIntegerSlider : MonoBehaviour { public void Initialize() { this.slider.onGetValue = new Func(this.OnGetValue); this.slider.onSetValue = new Action(this.OnSetValue); this.slider.Initialize(this.uiSlider); } public void UpdateSlider() { this.slider.UpdateSlider(); } private int OnGetValue() { return (this.onGetValue == null) ? 0 : this.onGetValue(); } private void OnSetValue(int value) { if (this.onSetValue != null) { this.onSetValue(value); } } public Action onSetValue; public Func onGetValue; [ReadOnly] [SerializeField] private UISlider uiSlider; [NonSerialized] public IntegerSlider slider = new IntegerSlider(); }