title: Why is the mesh not rendering?
body: <p>I am working through a <a href="https://forum.unity3d.com/threads/open-source-procedural-hexagon-terrain.233296/" rel="nofollow noreferrer">tutorial here</a>. I have <a href="https://drive.google.com/file/d/0B_iu5yU9Jm1bR3F5RlIxNXUzcjg/view?usp=sharing" rel="nofollow noreferrer">the package shared through my google drive</a> for convenience.</p>
  
  <p>I have set up a scene that looks like this:<br>
  <a href="https://i.stack.imgur.com/OtdZg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OtdZg.png" alt="hexgrid main scene"></a></p>
  
  <p>The subject <code>GameObject</code> is <code>HexGridController</code> and three objects that are disabled: <code>center_fill</code>, <code>Backdrop</code>, <code>DiagnosticDisplay</code>.</p>
  
  <p>The grid controller is an otherwise empty GameObject except for attached script:<br>
  <a href="https://i.stack.imgur.com/jqRQa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jqRQa.png" alt="hex grid controller properties"></a>  </p>
  
  <p>...and the HexGridController script:</p>
  
  <pre><code>    public class HexGridController : MonoBehaviour, IGridInterface {
  
           public float cellWidth = 50F;
           public HexOrientation cellFacing = HexOrientation.Acute;
           public int cellCols = 20;
           public int cellRows = 14;
           public float degOffset = 0.0F;
           // ... snipped IGridInterface implementations
  
           // Use this for initialization
           private void Start () {
               print("Hexagonal Grid Controller started");
  
               print("hex vertices:");
               int idx = 0;
               foreach(var vert in vertices){
                   print(string.Format("\t[{0}]: {1}", idx, vert.ToString()));
                   ++idx;
               }
           }
  
           #region    HiddenInInspector: vertices, uv, triangles
           [HideInInspector]
           public static Vector3[] vertices = new Vector3[]
           {
                   new Vector3(0f, Hexagon.floor, 1f),        //    north
                   new Vector3(1f, Hexagon.floor, .5f),    //    northeast
                   new Vector3(1f, Hexagon.floor, -.5f),    //    southeast
                   new Vector3(0f, Hexagon.floor, -1f),    //    south
                   new Vector3(-1f , Hexagon.floor, -.5f),    //     southwest
                   new Vector3(-1f, Hexagon.floor, .5f),    //    northwest
           };
  
           [HideInInspector]
           public static Vector2[] uv = new Vector2[]
           {
               new Vector2(0.5F,1),    //    north
               new Vector2(1,0.75F),    //    northeast
               new Vector2(1,0.25F),    //    southeast
               new Vector2(0.5F,0),    //    south
               new Vector2(0,0.25F),    //     southwest
               new Vector2(0,0.75F),    //    northwest
           };
  
           [HideInInspector]
           public static int[] triangles = new int[]
           {
               1,5,0,
               1,4,5,
               1,2,4,
               2,3,4
           };
           #endregion
       }  
  </code></pre>
  
  <p>And finally, <code>HexGrid</code> is a <code>GameObject</code> with the following script attached:</p>
  
  <pre><code>public class Hexagon : MonoBehaviour {
       private MeshRenderer meshRenderer;
  
       public const float floor = 0;
  
       public HexGridController grid;
       public Texture texture;
  
       // Use this for initialization
       private void Start () {
           print("Hexagon started");
  
           HexGridController.vertices[0] = new Vector3((grid.cellWidth * Mathf.Cos((float)(2*Mathf.PI*(1+0.5)/6))), Hexagon.floor, (grid.cellWidth * Mathf.Sin((float)(2*Mathf.PI*(1+0.5)/6))));
           HexGridController.vertices[1] = new Vector3((grid.cellWidth * Mathf.Cos((float)(2*Mathf.PI*(0+0.5)/6))), Hexagon.floor, (grid.cellWidth * Mathf.Sin((float)(2*Mathf.PI*(0+0.5)/6))));
           HexGridController.vertices[2] = new Vector3((grid.cellWidth * Mathf.Cos((float)(2*Mathf.PI*(5+0.5)/6))), Hexagon.floor, (grid.cellWidth * Mathf.Sin((float)(2*Mathf.PI*(5+0.5)/6))));
           HexGridController.vertices[3] = new Vector3((grid.cellWidth * Mathf.Cos((float)(2*Mathf.PI*(4+0.5)/6))), Hexagon.floor, (grid.cellWidth * Mathf.Sin((float)(2*Mathf.PI*(4+0.5)/6))));
           HexGridController.vertices[4] = new Vector3((grid.cellWidth * Mathf.Cos((float)(2*Mathf.PI*(3+0.5)/6))), Hexagon.floor, (grid.cellWidth * Mathf.Sin((float)(2*Mathf.PI*(3+0.5)/6))));
           HexGridController.vertices[5] = new Vector3((grid.cellWidth * Mathf.Cos((float)(2*Mathf.PI*(2+0.5)/6))), Hexagon.floor, (grid.cellWidth * Mathf.Sin((float)(2*Mathf.PI*(2+0.5)/6))));
  
           SetUpMesh();
       }    
  
       private void SetUpMesh() {
           MeshFilter meshFilter = gameObject.AddComponent&lt;MeshFilter&gt;();
           gameObject.AddComponent&lt;MeshRenderer&gt;();
           meshRenderer = gameObject.GetComponent&lt;MeshRenderer&gt;();
  
           Mesh mesh = new Mesh();
           //vertices
           mesh.vertices = HexGridController.vertices;
           //triangles
           mesh.triangles = HexGridController.triangles;
           //UV vectors
           mesh.uv = HexGridController.uv;
  
           //recalc for lighting
           mesh.RecalculateNormals();
  
           //game object's mesh filter
           meshFilter.mesh = mesh;
  
           //set to null when not testing
           meshRenderer.material.mainTexture = texture; 
       }
  
       private void Update () 
       {
  
       }
  
       private void OnDestory()
       {
           Object.Destroy(meshRenderer.material);
       }
   }
  </code></pre>
  
  <p><strong>NOTE:</strong><br>
  For what it's worth, <code>Hex Facing</code> is the hexagonal orientation at <kbd>North</kbd> - either flat or acute (or, pointy). I intend for the north-most point to be 0 and rotate clockwise:</p>
  
  <p>0 - <kbd>North</kbd><br>
  1 - <kbd>NorthEast</kbd><br>
  2 - <kbd>SouthEast</kbd><br>
  3 - <kbd>South</kbd><br>
  4 - <kbd>SouthWest</kbd><br>
  5 - <kbd>NorthWest</kbd>  </p>