Created
July 24, 2016 10:48
-
-
Save ted80/77f2e50d2c639195e00af1af6d15c4d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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