// TODO: this script should be caching as much data as possible - we can add and remove a single row // from the mesh at a time. We can probably do something with the meshes to make them triangle // strips from the get-go, rather than relying on Unity to do it. One option is to use multiple game objects // with this script attached. void UpdateTerrainMesh(GridMesh gridMesh) { // Calculate the number of terrain units the grid has shifted along the x-z plane IPoint dp = new IPoint((int)(transform.position.x - oldPosition.x), (int)(transform.position.z - oldPosition.z)); gridMesh.Shift(dp); }