private void init() { terrainMesh = new List <Mesh>(); meshFilter = this.gameObject.AddComponent <MeshFilter>(); meshRenderer = this.gameObject.AddComponent <MeshRenderer>(); //Debug.Log(meshRenderer.material); terrainMesh.Add(MeshCreator.GridMesh(1.0f, 10)); meshFilter.mesh = terrainMesh[0]; }