public static void SetClothingModel(SkinnedMeshRenderer baseClothing, ClothingData newClothing) { // Set bind poses newClothing.mesh.bindposes = baseClothing.sharedMesh.bindposes; // Set new mesh to old mesh renderer baseClothing.sharedMesh = newClothing.mesh; // set new textures SetClothingTextures(baseClothing.sharedMaterial, newClothing.textures); }
public static void SetShoeModel(SkinnedMeshRenderer leftShoe, SkinnedMeshRenderer rightShoe, ClothingData clothingData) { // Create Right Shoe Mesh Mesh tempRightShoe = MirrorClothingMesh(clothingData.mesh); // Set Bind poses to new shoes clothingData.mesh.bindposes = leftShoe.sharedMesh.bindposes; tempRightShoe.bindposes = rightShoe.sharedMesh.bindposes; // Set new shoe to old she mesh renderer leftShoe.sharedMesh = clothingData.mesh; rightShoe.sharedMesh = tempRightShoe; // Set new shoe Textures SetClothingTextures(leftShoe.sharedMaterial, clothingData.textures); }