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;
}
