/// \endcond /// \cond public override void InitializeExistingCubiquityVolume() { // This function might get called multiple times. E.g the user might call it striaght after crating the volume (so // they can add some initial data to the volume) and it might then get called again by OnEnable(). Handle this safely. if (volumeHandle == null) { // Create an empty region of the desired size. volumeHandle = CubiquityDLL.NewTerrainVolumeFromVDB(fullPathToVoxelDatabase, DefaultBaseNodeSize); } }
/// \endcond /// \cond protected override void InitializeExistingCubiquityVolume() { // We check 'mVolumeHandle' instead of 'volumeHandle' as the getter for the latter will in turn call this method. DebugUtils.Assert(mVolumeHandle == null, "Volume handle should be null prior to initializing volume"); if (!initializeAlreadyFailed) // If it failed before it will fail again - avoid spamming error messages. { try { // Create an empty region of the desired size. volumeHandle = CubiquityDLL.NewTerrainVolumeFromVDB(fullPathToVoxelDatabase, writePermissions, DefaultBaseNodeSize); } catch (CubiquityException exception) { volumeHandle = null; initializeAlreadyFailed = true; Debug.LogException(exception); Debug.LogError("Failed to open voxel database '" + fullPathToVoxelDatabase + "'"); } } }