How do I swap out the mesh component in a MeshFilter?
Say I have a MeshFilter which uses mesh “Cube”, but there is another mesh in the assets (but not currently used in the game) called “Sphere”, how do I swap them over?
You would typically use Resources.Load in Start to load all meshes you will need and only swap references during the game.
However, using Resources.Load has the disadvantage that every scene in your game will contain these meshes (as Unity cannot know when you might decide to load them). If you have other scenes, it’s probably better to just give your script a number of mesh variables (or just an array) and drag all the meshes you need into these variables in the inspector.