Pretty close, except possibly for the “differently-textured” bit, if by that you mean using multiple textures. Since you can only use one texture per mesh (if you want to keep draw calls to one). But you can use a texture atlas and map different UVs on the quads, which usually amounts to much the same thing.
Also, you don’t necessarily need to just use quads, unless you’re interested in making 2D sprites. All the separate-but-combined bits can be any shape you want really.
For more flexibility, you can make the skinned mesh by code. A while ago, I was doing some comparisons of skinned mesh sprites vs. manually updated combined mesh sprites, and did this for making boned quads:
var numberOfObjects = 50;
var mat : Material;
function Start () {
var smRenderer : SkinnedMeshRenderer = gameObject.AddComponent(SkinnedMeshRenderer);
renderer.material = mat;
// Build basic mesh
var aMesh : Mesh = new Mesh ();
var newVertices = new Vector3[4 * numberOfObjects];
var newUV = new Vector2[4 * numberOfObjects];
var newTris = new int[6 * numberOfObjects];
var index = 0;
var triIndex = 0;
var offset = 0;
for (i = 0; i < numberOfObjects; i++) {
newUV[index] = Vector2(0.0, 0.0);
newVertices[index++] = Vector3(-.5, -.5, 0.0);
newUV[index] = Vector2(1.0, 0.0);
newVertices[index++] = Vector3(.5, -.5, 0.0);
newUV[index] = Vector2(0.0, 1.0);
newVertices[index++] = Vector3(-.5, .5, 0.0);
newUV[index] = Vector2(1.0, 1.0);
newVertices[index++] = Vector3(.5, .5, 0.0);
newTris[triIndex++] = 0+offset;
newTris[triIndex++] = 1+offset;
newTris[triIndex++] = 2+offset;
newTris[triIndex++] = 1+offset;
newTris[triIndex++] = 3+offset;
newTris[triIndex++] = 2+offset;
offset += 4;
}
aMesh.vertices = newVertices;
aMesh.uv = newUV;
aMesh.triangles = newTris;
aMesh.RecalculateNormals();
// Assign bone weights to mesh
var weights = new BoneWeight[4 * numberOfObjects];
index = 0;
for (i = 0; i < numberOfObjects; i++) {
weights[index].weight0 = 1;
weights[index++].boneIndex0 = i;
weights[index].weight0 = 1;
weights[index++].boneIndex0 = i;
weights[index].weight0 = 1;
weights[index++].boneIndex0 = i;
weights[index].weight0 = 1;
weights[index++].boneIndex0 = i;
}
aMesh.boneWeights = weights;
// Make bones
var aBones = new Transform[numberOfObjects];
var bindPoses = new Matrix4x4[numberOfObjects];
for (i = 0; i < numberOfObjects; i++) {
aBones[i] = new GameObject("Bone", Rigidbody).transform;
aBones[i].eulerAngles = Vector3(0.0, 0.0, Random.Range(0.0, 360.0));
aBones[i].rigidbody.AddTorque(Vector3(0.0, 0.0, Random.Range(0.0, 360.0)) * Random.Range(1.0, 20.0));
aBones[i].rigidbody.AddRelativeForce(Vector3.up * Random.Range(20, 25));
aBones[i].rigidbody.useGravity = false;
bindPoses[i] = Matrix4x4.identity;
}
// Assign bones and bind poses and mesh
smRenderer.bones = aBones;
aMesh.bindposes = bindPoses;
smRenderer.sharedMesh = aMesh;
}
The results, by the way, were that the skinned mesh technique was about 20% faster, but that’s just on my computer…haven’t tested on the iPhone.
–Eric