YotogiOldParamBasicBarPlusSlider.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. public class YotogiOldParamBasicBarPlusSlider : YotogiOldParamBasicBar
  3. {
  4. public override void Awake()
  5. {
  6. base.Awake();
  7. this.slider_ = UTY.GetChildObject(base.gameObject.transform.parent.gameObject, "Slide", false).GetComponentInChildren<UISlider>();
  8. this.slider_.onChange.Clear();
  9. EventDelegate.Add(this.slider_.onChange, new EventDelegate.Callback(this.OnChangeSliderValue));
  10. }
  11. public override void SetCurrentExcite(int cur_num, bool is_anime)
  12. {
  13. base.SetCurrentExcite(cur_num, is_anime);
  14. float value = (float)(cur_num + 100) / 400f;
  15. this.set_change_ = true;
  16. this.slider_.value = value;
  17. this.set_change_ = false;
  18. }
  19. private void OnChangeSliderValue()
  20. {
  21. if (this.maid_ == null || this.set_change_)
  22. {
  23. return;
  24. }
  25. float value = UIProgressBar.current.value;
  26. int num = (int)(400f * value - 100f);
  27. if (this.maid_.status.currentExcite != num)
  28. {
  29. this.maid_.status.currentExcite = num;
  30. this.SetCurrentExcite(num, true);
  31. }
  32. }
  33. private UISlider slider_;
  34. private bool set_change_;
  35. }