using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.UI;

public class ScrollTest : MonoBehaviour
{
    // Start is called before the first frame update
    private ScrollRect scroll;
    void Start()
    {
        scroll = gameObject.GetComponent<ScrollRect>();
    }
    private bool dir = true;
    // Update is called once per frame
    void Update()
    {
        if (dir)
        {
            scroll.horizontalNormalizedPosition += 0.01f;
            if (scroll.horizontalNormalizedPosition >= 1)
            {
                dir = false;
            }
        }
        else 
        {
            scroll.horizontalNormalizedPosition -= 0.01f;
            if (scroll.horizontalNormalizedPosition <= 0)
            {
                dir = true;
            }
        }
    }
}
