summaryrefslogtreecommitdiff
path: root/Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/Scroller.cs
blob: 9ed4b908fda4800db65e855782fd0835fb07e092 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Scroller : MonoBehaviour
{
    [SerializeField] private RawImage _img;
    [SerializeField] private float _x, _y;

    void Update()
    {
        _img.uvRect = new Rect(_img.uvRect.position + new Vector2(_x, _y) * Time.deltaTime, _img.uvRect.size);
    }
}