예제 #1
0
        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);
        }
예제 #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        SplitMesh myScript = (SplitMesh)target;

        if (Application.isPlaying)
        {
            if (GUILayout.Button("Split"))
            {
                myScript.Split();
            }
        }
    }
예제 #3
0
        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);
        }