public override void CommitChanges() { if (!IsVolumeHandleNull()) { if (writePermissions == WritePermissions.ReadOnly) { throw new InvalidOperationException("Cannot commit changes to read-only voxel database (" + fullPathToVoxelDatabase + ")"); } CubiquityDLL.AcceptOverrideBlocks(volumeHandle.Value); //We can discard the blocks now that they have been accepted. CubiquityDLL.DiscardOverrideBlocks(volumeHandle.Value); } }
/// \endcond /// \cond public override void ShutdownCubiquityVolume() { if (volumeHandle.HasValue) { // We only save if we are in editor mode, not if we are playing. bool saveChanges = !Application.isPlaying; if (saveChanges) { CubiquityDLL.AcceptOverrideBlocks(volumeHandle.Value); } CubiquityDLL.DiscardOverrideBlocks(volumeHandle.Value); CubiquityDLL.DeleteColoredCubesVolume(volumeHandle.Value); volumeHandle = null; } }