Advertisement
Tarodev

Untitled

Sep 2nd, 2021
7,129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class Scroller : MonoBehaviour {
  7.     [SerializeField] private RawImage _img;
  8.     [SerializeField] private float _x, _y;
  9.  
  10.     void Update()
  11.     {
  12.         _img.uvRect = new Rect(_img.uvRect.position + new Vector2(_x,_y) * Time.deltaTime,_img.uvRect.size);
  13.     }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement