12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using UnityEngine;
- public class WindowContentListParent : MonoBehaviour
- {
- private void Awake()
- {
- }
- private void Start()
- {
- BoxCollider[] componentsInChildren = base.GetComponentsInChildren<BoxCollider>();
- this.scrollView = base.GetComponentInChildren<UIScrollView>();
- if (this.scrollView != null && (this.scrollView.horizontalScrollBar != null || this.scrollView.verticalScrollBar != null))
- {
- this.targetProgressBar = ((!(this.scrollView.horizontalScrollBar != null)) ? this.scrollView.verticalScrollBar : this.scrollView.horizontalScrollBar);
- foreach (BoxCollider boxCollider in componentsInChildren)
- {
- UIDragScrollView component = boxCollider.GetComponent<UIDragScrollView>();
- if (!(component == null))
- {
- if (component.scrollView == this.scrollView && component.GetComponentInChildren<UIButton>() == null)
- {
- this.dragMatBoxCollider = boxCollider;
- break;
- }
- }
- }
- }
- }
- private void Update()
- {
- if (this.dragMatBoxCollider == null)
- {
- return;
- }
- this.dragMatBoxCollider.enabled = (this.targetProgressBar.alpha == 1f);
- }
- private BoxCollider dragMatBoxCollider;
- private UIScrollView scrollView;
- private UIProgressBar targetProgressBar;
- }
|