WindowContentListParent.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using UnityEngine;
  3. public class WindowContentListParent : MonoBehaviour
  4. {
  5. private void Awake()
  6. {
  7. }
  8. private void Start()
  9. {
  10. BoxCollider[] componentsInChildren = base.GetComponentsInChildren<BoxCollider>();
  11. this.scrollView = base.GetComponentInChildren<UIScrollView>();
  12. if (this.scrollView != null && (this.scrollView.horizontalScrollBar != null || this.scrollView.verticalScrollBar != null))
  13. {
  14. this.targetProgressBar = ((!(this.scrollView.horizontalScrollBar != null)) ? this.scrollView.verticalScrollBar : this.scrollView.horizontalScrollBar);
  15. foreach (BoxCollider boxCollider in componentsInChildren)
  16. {
  17. UIDragScrollView component = boxCollider.GetComponent<UIDragScrollView>();
  18. if (!(component == null))
  19. {
  20. if (component.scrollView == this.scrollView && component.GetComponentInChildren<UIButton>() == null)
  21. {
  22. this.dragMatBoxCollider = boxCollider;
  23. break;
  24. }
  25. }
  26. }
  27. }
  28. }
  29. private void Update()
  30. {
  31. if (this.dragMatBoxCollider == null)
  32. {
  33. return;
  34. }
  35. this.dragMatBoxCollider.enabled = (this.targetProgressBar.alpha == 1f);
  36. }
  37. private BoxCollider dragMatBoxCollider;
  38. private UIScrollView scrollView;
  39. private UIProgressBar targetProgressBar;
  40. }