void ReleaseResources() { if (_argsBuffer != null) { _argsBuffer.Release(); _argsBuffer = null; } if (_voxelData != null) { _voxelData.Dispose(); _voxelData = null; } }
void SampleMesh() { skinnedMesh.BakeMesh(_mesh); _bounds.Encapsulate(_mesh.bounds.min); _bounds.Encapsulate(_mesh.bounds.max); if (_voxelData != null) { _voxelData.Dispose(); _voxelData = null; } _voxelData = GPUVoxelizer.Voxelize(voxelizer, _mesh, resolution); }