public ActiveChunk GetChunk(int x, int y, bool load = true) { var hashKey = GetChunkHash(x, y); ActiveChunk chunk = chunks[hashKey] as ActiveChunk; if (chunk == null && load) { var data = cache.Get(x, y); chunk = new ActiveChunk(world, data, x, y); chunk.Initialize(); chunks.Add(hashKey, chunk); } return chunk; }
private void UpdateChunk() { ActiveChunk.BuildMesh(meshData); }