using UnityEngine; public static class MeshGenerator { public static MeshData GenerateTerrainMesh(float[,] heightMap) { int width = heightMap.GetLength(0); int height = heightMap.GetLength(1); float topLeftX = (width - 1) / -2f; float topLeftZ = (height - 1) / 2f; MeshData meshData = new(width, height); int vertexIndex = 0; for(int y=0; y