Ejemplo n.º 1
0
    /// <summary>
    /// Load the next chunk in the chunk load queue.
    /// </summary>
    private void LoadNextChunk()
    {
        Vector3Int chunkID = _chunkLoadQueue.Dequeue();

        if (_chunks.ContainsKey(chunkID) == false)
        {
            WorldChunk newChunk = InitializeChunk(chunkID);
            _chunks.Add(chunkID, newChunk);
        }
        WorldChunk chunk = _chunks[chunkID];

        chunk.gameObject.SetActive(true);
        if (chunk.IsLoaded == false)
        {
            chunk.BuildMesh();
        }
    }