void CreateMeshColumns()
 {
     meshes = new List <GameObject>();
     foreach (VoronoiCell cell in voronoi.voronoiCells)
     {
         if (cell.isValid)
         {
             int corners = cell.boundaryPoints.Count;
             if (VERBOSE)
             {
                 Debug.Log("Corners: " + corners);
             }
             if (corners >= 3)
             {
                 GameObject          obj = Instantiate(ColumnMeshPrefab, Vector3.zero, Quaternion.identity);
                 ColumnMeshGenerator cmg = obj.AddComponent <ColumnMeshGenerator>() as ColumnMeshGenerator;
                 cmg.Init(cell, 10f, createBottomFace);
                 meshes.Add(obj);
             }
         }
     }
     if (VERBOSE)
     {
         Debug.Log("Number of meshes: " + meshes.Count);
     }
 }
Exemple #2
0
 private void CreateMeshColumns()
 {
     meshObjects = new List <GameObject>();
     foreach (VoronoiCell cell in voronoi.voronoiCells)
     {
         if (cell.isValid)
         {
             int corners = cell.boundaryPoints.Count;
             if (VERBOSE)
             {
                 Debug.Log("Corners: " + corners);
             }
             if (corners >= 3)
             {
                 // set object at cell.center, in cmg.Init() all boundary points get converted with that in mind
                 //GameObject obj = Instantiate(columnMeshPrefab, Vector3.zero, Quaternion.identity);
                 GameObject          obj = Instantiate(columnMeshPrefab, cell.center, Quaternion.identity);
                 ColumnMeshGenerator cmg = obj.AddComponent <ColumnMeshGenerator>() as ColumnMeshGenerator;
                 cmg.Init(cell, columnLength, createBottomFace);
                 meshObjects.Add(obj);
                 cell.theMeshObject = obj;
             }
         }
     }
     if (VERBOSE)
     {
         Debug.Log("Number of meshObjects: " + meshObjects.Count);
     }
 }