public static void DoStrip(ProBuilderMesh pb)
        {
            try
            {
                GameObject go = pb.gameObject;

                Renderer ren = go.GetComponent <Renderer>();

                if (ren != null)
                {
                    EditorUtility.SetSelectionRenderState(ren, EditorSelectedRenderState.Highlight | EditorSelectedRenderState.Wireframe);
                }

                if (EditorUtility.IsPrefabAsset(go))
                {
                    return;
                }

                EditorUtility.SynchronizeWithMeshFilter(pb);

                if (pb.mesh == null)
                {
                    DestroyProBuilderMeshAndDependencies(go, pb, false);
                    return;
                }

                string cachedMeshPath;
                Mesh   cachedMesh;

                // if meshes are assets and the mesh cache is valid don't duplicate the mesh to an instance.
                if (Experimental.meshesAreAssets && EditorMeshUtility.GetCachedMesh(pb, out cachedMeshPath, out cachedMesh))
                {
                    DestroyProBuilderMeshAndDependencies(go, pb, true);
                }
                else
                {
                    Mesh m = UnityEngine.ProBuilder.MeshUtility.DeepCopy(pb.mesh);

                    DestroyProBuilderMeshAndDependencies(go, pb);

                    go.GetComponent <MeshFilter>().sharedMesh = m;
                    if (go.TryGetComponent(out MeshCollider meshCollider))
                    {
                        meshCollider.sharedMesh = m;
                    }
                }
            }
            catch {}
        }
        public static void DoStrip(ProBuilderMesh pb)
        {
            try
            {
                GameObject go = pb.gameObject;

                Renderer ren = go.GetComponent <Renderer>();

                if (ren != null)
                {
                    EditorUtility.SetSelectionRenderState(ren, EditorUtility.GetSelectionRenderState());
                }

                if (EditorUtility.IsPrefabAsset(go))
                {
                    return;
                }

                EditorUtility.SynchronizeWithMeshFilter(pb);

                if (pb.mesh == null)
                {
                    DestroyImmediate(pb);

                    if (go.GetComponent <Entity>())
                    {
                        DestroyImmediate(go.GetComponent <Entity>());
                    }

                    return;
                }

                string cachedMeshPath;
                Mesh   cachedMesh;

                // if meshes are assets and the mesh cache is valid don't duplicate the mesh to an instance.
                if (Experimental.meshesAreAssets && EditorMeshUtility.GetCachedMesh(pb, out cachedMeshPath, out cachedMesh))
                {
                    pb.preserveMeshAssetOnDestroy = true;
                    DestroyImmediate(pb);
                    if (go.GetComponent <Entity>())
                    {
                        DestroyImmediate(go.GetComponent <Entity>());
                    }
                }
                else
                {
                    Mesh m = UnityEngine.ProBuilder.MeshUtility.DeepCopy(pb.mesh);

                    DestroyImmediate(pb);

                    if (go.GetComponent <Entity>())
                    {
                        DestroyImmediate(go.GetComponent <Entity>());
                    }

                    go.GetComponent <MeshFilter>().sharedMesh = m;
                    if (go.GetComponent <MeshCollider>())
                    {
                        go.GetComponent <MeshCollider>().sharedMesh = m;
                    }
                }
            }
            catch {}
        }