Best way to animate icons (GUITexture)?

I want to animate a button at a specific timerate, ie. one new image to replace the old one each second.

But whats the best way to do this without performance getting hurt?

I tried simply using an animated gif inside the GUI Texture, but that wouldnt work at all. I guess animated gif’s for textures are out in unity?

Another method would be to load a new image programmatically into the GUI Texture, but that would require first loading the images into an array and then into the GUI Texture using a loop. Wouldnt that end up hurting performance though? And is this really the best way to go about this?

I doubt it. As long as you don’t hog cpu time (you might want to use coroutines/yield), I think it’ll be fine.

You might want to put the loop that changes the current image displayed in the Update function, or in the Start function if you plan on using coroutines.

You can use a MovieTexture as the texture for a button. Using a tool like QuickTime Pro, you can compile a set of still images into a movie and switch them at whatever rate you like.

Is MovieTexture a Unity Pro feature only? And if my movie file uses the xvid codec does that mean my end user needs xvid installed in his system too?

It’s pro-only.