public void InitialiseCubeSphere() { //Create faces for the cubesphere for (int i = 0; i < m_numberOfFaces; i++) { if (m_meshFaces[i] == null) { GameObject meshObj = new GameObject("Mesh"); meshObj.transform.parent = m_planetProperties.GetOrigin(); meshObj.AddComponent <MeshRenderer>().sharedMaterial = new Material(Shader.Find("Standard")); m_meshFaces[i] = meshObj.AddComponent <MeshFilter>(); m_meshFaces[i].sharedMesh = new Mesh(); } m_terrainFaces[i] = new CubeSphereFace(m_planetProperties, m_meshFaces[i].sharedMesh, m_resolution, m_directions[i]); } }