Skip to content

Instantly share code, notes, and snippets.

@LoganBarnett
Created April 22, 2013 18:34
Show Gist options
  • Select an option

  • Save LoganBarnett/5437366 to your computer and use it in GitHub Desktop.

Select an option

Save LoganBarnett/5437366 to your computer and use it in GitHub Desktop.
Animate a series of images like a gif.
IEnumerator Start() {
var i = 0;
while (true) {
renderer.material.mainTexture = textures[i];
yield return new WaitForSeconds(delays[i]);
++i;
if(i >= maxFrames) i = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment