/// \cond protected override void InitializeEmptyCubiquityVolume(Region region) { // We check 'mVolumeHandle' instead of 'volumeHandle' as the getter for the latter will in turn call this method. if (mVolumeHandle != null) { Debug.LogAssertion("Volume handle should be null prior to initializing volume"); return; } 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.NewEmptyTerrainVolume(region.lowerCorner.x, region.lowerCorner.y, region.lowerCorner.z, region.upperCorner.x, region.upperCorner.y, region.upperCorner.z, fullPathToVoxelDatabase, DefaultBaseNodeSize); } catch (CubiquityException exception) { volumeHandle = null; initializeAlreadyFailed = true; Debug.LogException(exception); Debug.LogError("Failed to open voxel database '" + fullPathToVoxelDatabase + "'"); } } }
/// \cond protected override void InitializeEmptyCubiquityVolume(Region region) { // 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.NewEmptyTerrainVolume(region.lowerCorner.x, region.lowerCorner.y, region.lowerCorner.z, region.upperCorner.x, region.upperCorner.y, region.upperCorner.z, fullPathToVoxelDatabase, DefaultBaseNodeSize); } }