public static void Redraw() { if (!dirtyChunks) { return; } foreach (MapChunk chunk in dirtyList) { PolyGen.Generate(chunk); } dirtyList.Clear(); dirtyChunks = false; }
public static void SpawnChunks() { int widthInChunks = MapGenerator.instance.Map.width / MapChunk.chunkSize; int heightInChunks = MapGenerator.instance.Map.height / MapChunk.chunkSize; for (int y = 0; y < heightInChunks; y++) { for (int x = 0; x < widthInChunks; x++) { MapChunk chunk = CreateChunk(x, y); PolyGen.Generate(chunk); } } Debug.Log(string.Format("ChunksWidth : {0} ChunksHeight : {1}", widthInChunks, heightInChunks)); }