using System;
using UnityEngine;

public class UIWFScrollBGAlphaSupport : MonoBehaviour
{
	private void Awake()
	{
		this.update_timing_ = UnityEngine.Random.Range(1, 30);
		this.widget_ = base.GetComponent<UIWidget>();
	}

	private void Start()
	{
		this.update_count_ = this.update_timing_;
	}

	private void Update()
	{
		if (this.update_count_ == this.update_timing_)
		{
			this.update_count_ = 0;
			if (this.TargetWidget == null || this.widget_ == null)
			{
				return;
			}
			this.widget_.alpha = this.TargetWidget.alpha;
		}
		else
		{
			this.update_count_++;
		}
	}

	public UIWidget TargetWidget;

	private UIWidget widget_;

	private int update_count_;

	private int update_timing_;
}
