Is there a way of playing animated GIFs through iPhone Unity?
Converting to a movie as an intermediate format wouldn't be an option unless it could be done on the fly.
Is there a way of playing animated GIFs through iPhone Unity?
Converting to a movie as an intermediate format wouldn't be an option unless it could be done on the fly.
Aisde from tiling the animation to one texture, you can cycle through individual texture frames:
var frames : Texture2D[];
var framesPerSecond = 10.0;
function Update () {
var index : int = Time.time * framesPerSecond;
index = index % frames.Length;
renderer.material.mainTexture = frames[index];
}
On the more complex end of the spectrum, you can script an animated .gif parser and use actual animated .gif files. For smaller sizes the speed would probably be acceptable.
Short answer: no. Long answer, you can't play animated gifs, you can play movie textures on iPhone either. So depending on the size of the animation, you'll need to tile the animation to one texture and animate the tiles. Although it's meant for Second Life, it should work for Unity as well: link.
There is a neat little script in the Unity Wiki that allows to "play" a series of textures without having to put them in a single one. You can also specify how many frames... very clean and effective. BUT you must convert your gif to a Unity readable format.