- Home /
How do you share a material like in the Match Game iPhone sample project?
In the iPhone Match game project, a single PSD is used for all of the different card faces. Does anyone know how the material is applied so that even though a single PSD is used, each card has a different image on the face?
Here is the link to download the iPhone Match Game sample project: http://unity3d.com/support/resources/example-projects/iphone-examples
Thanks.
Here's a quick reference to the Unity Documentation on $$anonymous$$aterials: http://unity3d.com/support/documentation/$$anonymous$$anual/$$anonymous$$aterials.html
Answer by zannghast · Oct 22, 2010 at 09:20 AM
The general idea behind this is understanding how textures are applied in Unity, and how you "adjust" those textures.
In Unity the textures are applied as follows:
Texture (imported asset) -> applied to -> Material (asset) -> applied to Mesh Renderer/Skinned Mesh Renderer (component)
"Adjusting" the material:
You will notice on every Material that there is an "Offset" property. Whenever you "attach" this asset to a mesh renderer component, you will have the ability to adjust the values of this property to "change" the position of the texture assigned to that material. If I'm not mistaken, you can adjust these values for every distinct object that uses the material.
In theory, you could have a 'texture atlas' and simply adjust the Offset property of the material to which that texture atlas is applied to.
Your answer
![](https://koobas.hobune.stream/wayback/20220613080429im_/https://answers.unity.com/themes/thub/images/avi.jpg)