File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ namespace Zigurous.Graphics
66 /// Combines the meshes of the children of the game object into one mesh.
77 /// </summary>
88 [ RequireComponent ( typeof ( MeshFilter ) ) ]
9+ [ RequireComponent ( typeof ( MeshRenderer ) ) ]
910 [ AddComponentMenu ( "Zigurous/Graphics/Combine Children Meshes" ) ]
1011 public sealed class CombineChildrenMeshes : MonoBehaviour
1112 {
@@ -21,6 +22,12 @@ public sealed class CombineChildrenMeshes : MonoBehaviour
2122 [ Tooltip ( "Removes the child meshes from the game object after combining." ) ]
2223 public bool removeChildMeshes = true ;
2324
25+ /// <summary>
26+ /// Combines all of the meshes into a single submesh.
27+ /// </summary>
28+ [ Tooltip ( "Combines all of the meshes into a single submesh." ) ]
29+ public bool mergeSubmeshes = true ;
30+
2431 /// <summary>
2532 /// Optimizes the combined mesh data to improve rendering performance.
2633 /// </summary>
@@ -79,7 +86,7 @@ public Mesh Combine()
7986 // Create a new mesh from all of the combined children
8087 Mesh combinedMesh = new Mesh ( ) ;
8188 combinedMesh . name = "Combined Mesh" ;
82- combinedMesh . CombineMeshes ( combine ) ;
89+ combinedMesh . CombineMeshes ( combine , mergeSubmeshes ) ;
8390
8491 if ( optimizeMesh ) {
8592 combinedMesh . Optimize ( ) ;
You can’t perform that action at this time.
0 commit comments