12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- public class YotogiParamBasicBarPlusSlider : YotogiParamBasicBar
- {
- public override void Awake()
- {
- base.Awake();
- this.slider_ = UTY.GetChildObject(base.gameObject.transform.parent.gameObject, "Slide", false).GetComponentInChildren<UISlider>();
- this.slider_.onChange.Clear();
- EventDelegate.Add(this.slider_.onChange, new EventDelegate.Callback(this.OnChangeSliderValue));
- }
- public override void SetCurrentExcite(int cur_num, bool is_anime)
- {
- base.SetCurrentExcite(cur_num, is_anime);
- float value = (float)(cur_num + 100) / 400f;
- this.set_change_ = true;
- this.slider_.value = value;
- this.set_change_ = false;
- }
- private void OnChangeSliderValue()
- {
- if (this.maid_ == null || this.set_change_)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- int num = (int)(400f * value - 100f);
- if (this.maid_.status.currentExcite != num)
- {
- this.maid_.status.currentExcite = num;
- this.SetCurrentExcite(num, true);
- }
- }
- private UISlider slider_;
- private bool set_change_;
- }
|