public void Unpin()
                {
                    Assert(_pinnedVoxels.IsAllocated);
                    voxels = new VoxelArray1D();
                    _pinnedVoxels.Free();

#if DEBUG_VOXEL_MESH
                    voxelsDebug = new Debug.VoxelArray1D();
                    _pinnedVoxelsDebug.Free();
#endif
                }
                public void Pin()
                {
                    Assert(!_pinnedVoxels.IsAllocated);
                    _pinnedVoxels = GCHandle.Alloc(_voxels, GCHandleType.Pinned);
                    unsafe {
                        voxels = VoxelArray1D.New((BlendedVoxel_t *)_pinnedVoxels.AddrOfPinnedObject().ToPointer(), _voxels.Length);
                    }
#if DEBUG_VOXEL_MESH
                    _pinnedVoxelsDebug = GCHandle.Alloc(_voxelsDebug, GCHandleType.Pinned);
                    unsafe {
                        voxelsDebug = Debug.VoxelArray1D.New((Debug.BlendedVoxel_t *)_pinnedVoxelsDebug.AddrOfPinnedObject().ToPointer(), _voxelsDebug.Length);
                    }
#endif
                }
Exemple #3
0
 public static GenerateChunkVertsDebug_t New(SmoothingVertsOutDebug_t smoothVerts, VoxelArray1D voxels, NativeArray <PinnedChunkData_t> area, TableStorage tableStorage, NativeArray <int> blockMaterials)
 {
     return(new GenerateChunkVertsDebug_t {
         _smoothVerts = smoothVerts,
         _voxels = voxels,
         _tables = Tables.New(tableStorage),
         _blockMaterials = blockMaterials,
         _area = area,
         _vn = new VoxelNeighbors_t()
     });
 }