/// <summary>
    /// Function that is called when point cloud is updated.
    /// </summary>
    /// <param name="obj">Object with parameters.</param>
    private void ARPointCloudManager_pointCloudsChanged(ARPointCloudChangedEventArgs obj)
    {
        if (addWhenTouched && !(Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Stationary))
        {
            return;
        }

        // here we use only the first element in array updated
        if (obj.updated.Count == 0)
        {
            return;
        }

        var updated = obj.updated[0];

        for (int i = 0; i < updated.positions.Length; ++i)
        {
            if (CheckPoint(updated.positions[i], updated.confidenceValues[i]))
            {
                voxelSet.AddPoint(updated.identifiers[i], updated.positions[i], updated.confidenceValues[i], Camera.current.transform.forward, uniteNearbyPoints);
            }
        }

        voxelSet.Update();
    }