Texture swap animator

Author: Eric Haines (Eric5h5)

Description
This script animates a texture on an object by using a series of frames. You can give it a framerate to determine the speed of the animation.

Usage
Attach this script to an object, then set the size of the Frames array and drag all the frames of the animation onto the appropriate slots. (Note that you can click the lock icon in the inspector and drag all the frames at once, rather than one at a time.) Set FramesPerSecond to the desired framerate.

TextureSwapAnimator.js
Here's another version, which uses sprites instead of Texture2D, and therefore requires Unity 4.3 or later. Also, it doesn't use Time.time, which eventually runs out of precision if you leave it going long enough. So this version can be left running forever (or until the power is cut) without any problems.