public void RebuildFloor(int startX, int endX, int startZ, int endZ) { for (int i = startX / map.ChunkSize; i <= endX / map.ChunkSize; i++) { for (int j = startZ / map.ChunkSize; j <= endZ / map.ChunkSize; j++) { ChunkDrawer chunk = GameObject.Find("chunk_" + activeLevel + "_" + i + "_" + j).GetComponent <ChunkDrawer>(); chunk.BuildMesh(); } } map.IsDirty = true; }
public IEnumerator RebuildFloor(int startX, int endX, int startZ, int endZ, int level) { for (int i = startX / map.ChunkSize; i <= endX / map.ChunkSize; i++) { for (int j = startZ / map.ChunkSize; j <= endZ / map.ChunkSize; j++) { ChunkDrawer chunk = GameObject.Find("chunk_" + level + "_" + i + "_" + j).GetComponent <ChunkDrawer>(); chunk.BuildMesh(); yield return(null); } } map.IsDirty = true; }