public void Clear()
 {
     //i think this causes a thread contention because we are updating the mesh in the Update call
     clearing    = true;
     insertCount = 0;
     regenerationQueue.Clear();
     dynamicMeshStorage.Clear();
     clearing = false;
 }
    public void Clear()
    {
        if (leftHashTree != null)
        {
            leftHashTree.Clear();
            leftHashTree = null;
        }
        if (rightHashTree != null)
        {
            rightHashTree.Clear();
            rightHashTree = null;
        }

        if (grid != null)
        {
            grid.Clear();
        }

        if (meshingCube != null)
        {
            GameObject.DestroyImmediate(meshingCube);
            meshingCube = null;
        }
    }