using UnityEngine;
using System.Collections;
public class creditsScroller : MonoBehaviour {
UIScrollView scrollView;
UIPanel _myPanel;
public float textMaxOffset = 3500f;//roughly a 100 line of text
public float scrollSpeed = -1f;//negative speed for text scrolling from down to up
void Start () {
scrollView = GetComponent<UIScrollView>();
_myPanel = GetComponent<UIPanel>();
}
void Update () {
scrollView.Scroll(Time.deltaTime * scrollSpeed);
if(_myPanel.clipOffset.y < -(textMaxOffset)){
scrollView.Scroll(0);
scrollView.ResetPosition();
}
}
}