public void Add(SplitMesh mesh) { foreach (Triangle3D newTriangle in mesh.triangles) { newTriangle.idxV0 += triangles.Count; newTriangle.idxV1 += triangles.Count; newTriangle.idxV2 += triangles.Count; } triangles.AddRange(mesh.triangles); vertices.AddRange(mesh.vertices); }
public override void OnInspectorGUI() { DrawDefaultInspector(); SplitMesh myScript = (SplitMesh)target; if (Application.isPlaying) { if (GUILayout.Button("Split")) { myScript.Split(); } } }