Hey guys I am trying to figure out the best way of doing this…
I have a door, that has a light on it (with textures only- door model is a 12poly box)). When the door is locked the light is red, when it is unlocked light is green.
Any ways, this door is on a larger texture atlas (512x512) which has the texture for the whole level.
My first though was to just have 2 texture atlases and switch between them… But this seems wasteful of resources to me (especially since this will be for an iPhone game).
My other idea is to have both lock “states” side by side on the texture atlas, and somehow switch between them.
So my question is… Is this possible?
If not possible, any one have a better idea to go about this?
Thanks.
What do you mean by change the UV’s them selves? I get what youa re saying that it may not seem worth it for this 12 poly model… but I bet it would come in handy later
Change the appropriate entries in mesh.uv so that the desired polygons show the part of the texture you want. Check out the docs on the Mesh class. (If you’re not familiar with the way meshes are constructed it might take a while to sink in, although it’s actually not that complex once you get the hang of it.)
Ok I looked the mesh class… .But couldn’t figure out how to go about it. From what I saw, I couldn’t see a way to get the existing UV coordinates, only make new ones?
Is there no way to get the existing UV’s of a model and just shift them over? I am thinking sort of like the old days with 2d sprites.