private void onAlreadyExistingChunk(TerrainChunk chunk) { if (chunk.GetDistanceFrom(viewerPosition) <= maxViewDistance) { chunk.Show(); lastVisibleChunks.Add(chunk); } else { chunk.Hide(); } }
private void onNewChunk(Vector2 chunkCoord) { var chunk = new TerrainChunk(chunkCoord, chunkSize, material); chunks.Add(chunkCoord, chunk); }
private int resolveLevelOfDetailForChunk(TerrainChunk chunk) { return(Mathf.FloorToInt((chunk.GetDistanceFrom(viewerPosition) / maxViewDistance) * MapGenerator.LevelsOfDetail)); }