- Home /
This question was
closed Aug 05, 2013 at 08:42 PM by
robertbu for the following reason:
Duplicate Question
How would you change a texture via script?
I'm making a 2d game and I want to change the texture over and over to make an animation. Can anyone give me any good advice or links to do this?
Comment
This question has been asked and answered many times. Several people have posted scripts to UA that change single textures. In the Wiki there are scripts that use a sprite sheet. Here is one:
http://wiki.unity3d.com/index.php/Animating_Tiled_texture_-_Extended
The most efficient solution in terms of game performance for sprites is to use an atlas and animate the uvs in the mesh itself. I've not seen code posted to UA for this functionality, but several third-party tools like EZGUI have it.