I am trying to create modified meshes with editor scripting.
I prepare the new mesh and save it as an asset. Then create a new game object and add a SkinnedMesh renderer on it. I want to load the Mesh asset and assign it to that skinnedMeshRenderer , and then save it as a prefab.
The problem is , SkinnedMeshRenderer.Mesh is not accesible. I can assign to SkinnedMeshRenderer.SharedMesh (with AssetDatabase ofcourse ) but when I save it as a prefab, the Mesh reference gets lost (seems normal as sharedMesh is just an instance).
Same problem is there for the Materials. Unity keeps crying about my code using “.Materials” instead of “.SharedMaterials” but when you use sharedMaterials same problem occurs.
Thanks in advance…