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
6
6
/// Combines the meshes of the children of the game object into one mesh.
7
7
/// </summary>
8
8
[ RequireComponent ( typeof ( MeshFilter ) ) ]
9
+ [ RequireComponent ( typeof ( MeshRenderer ) ) ]
9
10
[ AddComponentMenu ( "Zigurous/Graphics/Combine Children Meshes" ) ]
10
11
public sealed class CombineChildrenMeshes : MonoBehaviour
11
12
{
@@ -21,6 +22,12 @@ public sealed class CombineChildrenMeshes : MonoBehaviour
21
22
[ Tooltip ( "Removes the child meshes from the game object after combining." ) ]
22
23
public bool removeChildMeshes = true ;
23
24
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
+
24
31
/// <summary>
25
32
/// Optimizes the combined mesh data to improve rendering performance.
26
33
/// </summary>
@@ -79,7 +86,7 @@ public Mesh Combine()
79
86
// Create a new mesh from all of the combined children
80
87
Mesh combinedMesh = new Mesh ( ) ;
81
88
combinedMesh . name = "Combined Mesh" ;
82
- combinedMesh . CombineMeshes ( combine ) ;
89
+ combinedMesh . CombineMeshes ( combine , mergeSubmeshes ) ;
83
90
84
91
if ( optimizeMesh ) {
85
92
combinedMesh . Optimize ( ) ;
You can’t perform that action at this time.
0 commit comments