private bool IsNeighbourEmptyOf(NVoxel voxel, int direction) { // Neighbours position Vector3Int nbPos = voxel.Position + _directions[direction]; if (nbPos.x < 0 || nbPos.x >= _voxelList.GetLength(0) || nbPos.y < 0 || nbPos.y >= _voxelList.GetLength(1) || nbPos.z < 0 || nbPos.z >= _voxelList.GetLength(2) || _voxelList[nbPos.x, nbPos.y, nbPos.z].Type == NBlockType.Empty) { return(true); } return(false); }
public void Add(NVoxel voxel) { _voxelList[voxel.Position.x, voxel.Position.y, voxel.Position.z] = voxel; }