Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ted80
Created July 24, 2016 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ted80/77f2e50d2c639195e00af1af6d15c4d1 to your computer and use it in GitHub Desktop.
Save ted80/77f2e50d2c639195e00af1af6d15c4d1 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class WaterAnimation : MonoBehaviour
{
public float scrollSpeed = 0.5F;
public Renderer rend;
void Start()
{
rend = GetComponent<Renderer>();
}
void Update()
{
float offset = Time.time * scrollSpeed;
rend.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment