I’m trying to find a way to create an array that contains all the meshes that are in a model I’ve imported into my project. At the moment I have a model made up of 16 meshes. I need a reference to each mesh as the game plays, so I can swap them in and out. Right now I’ve done this by hand by creating the array, var theseMesh : Mesh[ ]; then hand placing each mesh from the project window into the array in the inspector. Can this be automated?
Along the same lines, I have another array that I would like to contain a bunch of gameObjects from the scene. Since I’m using GameObject.active, I want a reference to the game object itself, and not a component, as in Component.GetComponentsInChildren (and putting all the objects into a single group). Again, I’m not sure how to do this better than placing them in by hand. Help please!