using System;
using UnityEngine;

public class BattleScroll : UIRuleControler
{
	public void Awake()
	{
	}

	public void Start()
	{
		if (this.Image == null)
		{
			return;
		}
		this.Image.onRender = delegate(Material mat)
		{
			mat.mainTexture.wrapMode = TextureWrapMode.Repeat;
			mat.SetFloat("_UvScaleX", (float)this.RepetitionCount);
			mat.SetFloat("_TexOffsetX", this.scroll_val_ += this.Speed);
			mat.SetFloat("_Cutoff", this.m_fCutoff);
			float value = -this.m_fCutoff + (1f + this.m_fCutoff) * this.m_fStep;
			mat.SetFloat("_Step", value);
			mat.SetTexture("_RuleTex", this.m_texRule);
		};
	}

	public UI2DSprite Image;

	public float Speed;

	public int RepetitionCount;

	private float scroll_val_;
}
