Need guidance in multi-use menu accessing prefabs
I've been struggling with this for the past four or so days. I might be going about this all wrong.
A few good examples of the type of menu I'm trying to get: Don't Starve character selection ( Don't Starve ), the menus from SimCity/City Skylines for roads, or pretty much any racer game.
The idea is to have a horizontal menu with previous/next buttons to step through the elements of an array. I've gotten the functionality of the menu down.
So far I've been trying to use Resources.LoadAll to grab test prefabs I placed in the prefabs folder (simple gameobjects made by first creating an empty gameobject and adding a UI Image component then dropping a sprite into source image). Loading all the prefabs seems to be working, however I can't seem to figure out how to access the prefabs image component to reference what the sprite is and then apply it to the menu system so there's a preview of the object ( like how in Don't Starve's menu you get a large portrait of the character).
Is my thought process correct on this, create a prefab (containing the mesh, textures, UI icons, tool tips, scripts for various stats, associated sounds, animations) and load those into an array to then cycle through as a menu.
Or do I need to load all the components into unique arrays ( UI icons array, mesh array, etc)?
Or should I make it an array of buttons that when clicked instantiate the prefab they're associated with.
Right now I'm trying to use this concept to make a constructor environment ( think the Spore creature creator). Because I don't know how many parts I will end up with, and that I would like to leave it expandable for add-ons down the road. I'm not sure if hard coding a array size is a good idea. Though it's not like I can't rewrite the size of the array over and over.
Probably bad practice of me, but I've been rewriting the same code file, deleting, adding, commenting out. Over and over so I don't have any code worth showing.
It could just boil down to I'm not using a form of GetComponent correctly. Couldn't find something like what I'm trying to do to learn from. Been in a state similar to "Who is this actor, I can picture their face, hear their voice... but I just can't think of their name!" while trying to figure this out.