|
@@ -5,10 +5,12 @@ using UnityEngine;
|
|
|
|
|
|
namespace KairoEngine.Chunks
|
|
namespace KairoEngine.Chunks
|
|
{
|
|
{
|
|
|
|
+ [Serializable]
|
|
public class ChunkSystem<TChunkBlock>
|
|
public class ChunkSystem<TChunkBlock>
|
|
{
|
|
{
|
|
public Vector3Int chunkSize = new Vector3Int(16, 16, 16);
|
|
public Vector3Int chunkSize = new Vector3Int(16, 16, 16);
|
|
public Dictionary<Vector3Int, Chunk<TChunkBlock>> chunks;
|
|
public Dictionary<Vector3Int, Chunk<TChunkBlock>> chunks;
|
|
|
|
+ public List<Vector3Int> chunkList = new List<Vector3Int>();
|
|
|
|
|
|
public ChunkSystem(Vector3Int chunkSize, bool debug = false)
|
|
public ChunkSystem(Vector3Int chunkSize, bool debug = false)
|
|
{
|
|
{
|
|
@@ -20,6 +22,7 @@ namespace KairoEngine.Chunks
|
|
{
|
|
{
|
|
Chunk<TChunkBlock> chunk = new Chunk<TChunkBlock>(chunkSize, position, createChunkBlock);
|
|
Chunk<TChunkBlock> chunk = new Chunk<TChunkBlock>(chunkSize, position, createChunkBlock);
|
|
chunks.Add(position, chunk);
|
|
chunks.Add(position, chunk);
|
|
|
|
+ chunkList.Add(position);
|
|
}
|
|
}
|
|
|
|
|
|
public TChunkBlock GetBlock(Vector3Int position)
|
|
public TChunkBlock GetBlock(Vector3Int position)
|