// Update is called once per frame
    void LateUpdate()
    {
        frameCount++;

#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.C))
        {
            occupancyManager.Clear();
        }

        if ((frameCount % 6) == 0)
        {
            float start = Time.realtimeSinceStartup;

            for (int i = 0; i < insertionCount; i++)
            {
                int x   = UnityEngine.Random.Range(0, Screen.width);
                int y   = UnityEngine.Random.Range(0, Screen.height);
                Ray ray = mainCamera.ScreenPointToRay(new Vector3(x, y, 0));
                if (Physics.Raycast(ray, out hitInfo, 4, virutalRoomLayer))
                {
                    occupancyManager.InsertPoint(hitInfo.point, ray.direction, 1.0f / (hitInfo.distance + 1));
                }
            }
            occupancyManager.QueueDirtyMeshesForRegeneration();

            float stop = Time.realtimeSinceStartup;
            occupancyManager.InsertionTime = occupancyManager.InsertionTime * occupancyManager.Smoothing + (1.0f - occupancyManager.Smoothing) * (stop - start);
        }
#endif
    }
 /// <summary>
 /// Reset Point Cloud preview, history, and mesh data.
 /// </summary>
 public void Reset()
 {
     ClearLivePreviewCubes();
     m_positionHistory.Clear();
     m_meshManager.Clear();
 }
 public void Reset()
 {
     ClearQuads();
     m_positionHistory.Clear();
     m_occupancyManager.Clear();
 }