Do you want to combine meshes into one single mesh in Unity? This tutorial explains how to use unity's CombineMeshes function to do that.
Combine meshes in Unity.
Create a new Unity3D project. Call it CombineMeshTest
Create an empty GameObject and rename it to app
Select app
Add component MeshFilter
Add component MeshRenderer
Set the mesh renderer material (Mesh Renderer, Materials, Element 0) to Default material
Add New Script and call it App
Doubleclick App to open in Visual Studio
Replace the generated code with:
using System.Collections.Generic;
using UnityEngine;
public class App : MonoBehaviour
{
public Mesh Mesh1;
public Mesh Mesh2;
private void Start()
{
var mesh = CombineMeshes(new List<Mesh> { Mesh1, Mesh2 });
GetComponent<MeshFilter>().mesh = mesh;
}
private Mesh CombineMeshes(List<Mesh> meshes)
{
var combine = new CombineInstance[meshes.Count];
for (int i = 0; i < meshes.Count; i++)
{
combine[i].mesh = meshes[i];
combine[i].transform = transform.localToWorldMatrix;
}
var mesh = new Mesh();
mesh.CombineMeshes(combine);
return mesh;
}
}