using System; using UnityEngine; public class OnaholeNodeSlider : MonoBehaviour, IOnaholeNodeButton { public string text { get { return this.textLabel.text; } set { this.textLabel.text = ((!string.IsNullOrEmpty(value)) ? value : string.Empty); } } public string uniqueName { get; set; } public OnaholeNodeButton.SelectType selectType { get { return this.selectType_; } set { this.selectType_ = value; if (value == OnaholeNodeButton.SelectType.None) { this.bg.alpha = this.defaultBGAlpha; this.textLabel.color = Color.white; } else if (value == OnaholeNodeButton.SelectType.Focus) { this.bg.alpha = 1f; this.textLabel.color = Color.white; } else if (value == OnaholeNodeButton.SelectType.Select) { this.bg.alpha = 1f; this.textLabel.color = Color.yellow; } } } public float sliderValue { get { return (this.sliderData == null) ? 0f : this.sliderData.slider.value; } set { if (this.sliderData != null) { this.sliderData.slider.value = value; } } } public void Awake() { this.defaultBGAlpha = this.bg.alpha; this.selectType = OnaholeNodeButton.SelectType.None; } public void SetSliderType(OnaholeNodeSlider.SliderType type) { } private void Update() { } private void OnChangeSliderValue(AbstractSliderData obj) { obj.ChangeSliderValue(); } GameObject IOnaholeNodeButton.get_gameObject() { return base.gameObject; } [SerializeField] private UIWidget bg; [SerializeField] private UILabel textLabel; [SerializeField] private UISlider valueSlider; private float defaultBGAlpha; private OnaholeNodeButton.SelectType selectType_; private AbstractSliderData sliderData; public enum SliderType { Sensitivity, HoleSync, HoleAutoSpeed, HoleAutoInsertStartPos, HoleAutoInsertEndPos, MaidSensitivity, ManAlpha } }