Created
September 18, 2020 07:07
-
-
Save stephanmg/d6a6de1fb6a57c6bfd1dd103e5bbe4bd to your computer and use it in GitHub Desktop.
Save mesh as prefab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GameObject cone = GameObject.Find("cone"); | |
Mesh mesh = cone.GetComponent<MeshFilter>().sharedMesh; | |
AssetDatabase.CreateAsset(msh, assetpath); | |
PrefabUtility.SaveAsPrefabAsset(mesh, prefabpath); | |
AssetDatabase.SaveAssets(); | |
AssetDatabase.Refresh(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment