Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
//Scrolling Textures
using UnityEngine; using System.Collections; public class HorizontallyScrollingTextures : MonoBehaviour { public float horizontalScrollSpeed, verticalScrollSpeed = 0.5f; private Mesh mesh; void Start() { mesh = GetComponent<MeshFilter>().mesh; } void Update() { SwapUVs(); } void SwapUVs() { Vector2[] uvSwap = mesh.uv; for (int i = 0; i < uvSwap.Length; i ++) { uvSwap[i] += new Vector2( horizontalScrollSpeed * Time.deltaTime, verticalScrollSpeed * Time.deltaTime ); } mesh.uv = uvSwap; } }