private void LoadChunk(VoxelWorld _voxel_world, intVector3 _position) { if (_voxel_world.GetChunk(_position.x, _position.y, _position.z) == null) { _voxel_world.CreateChunk(_position.x, _position.y, _position.z); } }
void Start() { world = GameObject.Instantiate(VoxelWorld.prefab); world.gameController = this; for (int x = 0; x <= startingSize.x; x++) { for (int z = 0; z <= startingSize.y; z++) { // Subtract half of starting size to make the world centered over origin world.CreateChunk(new Vector2Int(x - startingSize.x / 2, z - startingSize.y / 2)); } } StartCoroutine(GenerateIteratively(world)); }