Using multiple textures per material

How does one make a material that has multiple textures and how does one change those textures at run time?

Our game is a dress up/fashion game. There are ~35 layers/types of clothing (including tattoos and makeup). Many things are mounted (belts, hair, mustaches, glasses, etc.) but quite a few are not. The doll has 4 skinned meshes (body (divided into regions to allow different tattoos), upper (shirts, vests, bikini tops, etc.), lower (pants, shorts, socks, etc.) and over (dress, coat, cape, etc.)). Each mesh has a material. Different layers of clothing go in different parts of the mesh - bra is upper[1], undershirt is upper[2], necklace is upper[3], overshirt is upper[4], jacket is over[1], etc. We could, of course, use multiple skinned meshes but those get to be a real pain once you have several

In T3D (where we prototyped the game), a material has a texture array and setting/changing one was done with the code myMaterial.diffuseMap[1] = "tshirt.png". i'm trying to find the Unity equivalent. i'm fairly sure Unity supports multiple textures per material (the skybox seems to use 6), i just haven't figured out the keywords to make it work

Generally, a material only has more than one texture when those textures are used in combination with each other on a single mesh - such as a lightmap on top of a diffuse map, or a bump map and reflection map applied over a diffuse map. The skybox material is an unusual exception to this rule (and I'm not sure how it works!).

However, if you want to do this kind of character skinning using texture swapping in Unity, the more typical way would be to apply a different material to each mesh using the renderer.material property of the renderer on each mesh. Or, if the separate parts of the body that you mention are collapsed into a single multi-material mesh (i.e. it has submeshes), you would assign a different material to each element in the renderer.materials array.

Also important to note is that if you modify a Renderer's materials in this way and any other Renderers were using the same material, it will generate a temporary runtime clone of the Material. Other renderers will go on using the original. In practice, this means if you change one avatar's clothing, all other avatars will remain untouched. If you want to affect all instances of a material, use .sharedMaterial or .sharedMaterials instead.

You may want to look at http://unity3d.com/support/resources/example-projects/charactercustomization example project. A lot of it's focus is downloading AssetBundles, but is basically a "dress up/fashion game" prototype done by unity Programmers.