24 lines
423 B
C#
24 lines
423 B
C#
using UnityEngine;
|
|
|
|
public class RefractionScroll : MonoBehaviour
|
|
{
|
|
public Vector2 bumpMap1Speed;
|
|
|
|
private Vector2 bumpMap1UV;
|
|
|
|
private Renderer rend;
|
|
|
|
private void Start()
|
|
{
|
|
bumpMap1Speed /= 10f;
|
|
rend = GetComponent<Renderer>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
bumpMap1UV.x = Time.time * bumpMap1Speed.x;
|
|
bumpMap1UV.y = Time.time * bumpMap1Speed.y;
|
|
rend.material.SetTextureOffset("_AltMap", bumpMap1UV);
|
|
}
|
|
}
|