Lets say we have a player with three weapon slots, and a whole lot of weapon options in the game, and each one fires/works quite differently. Naturally, we give each weapon a script. The player has 3 buttons corresponding to his 3 weapon slots, so they can be fired at will.
So what is the best way to "load" a weapon into an empty weapon slot when it acquired, then find and perform that weapon's function when that corresponding button is pushed? I KNOW Unity has an easy way to do this, but I'm totally stumped. I was thinking some kind of Child/Parent hierarchy with prefabs, but I'm not sure.
Usually, you'd have one script that handles the logic required for a weapon "firing" which you'd attach to the different weapon prefabs. This script would usually have a couple of properties (more technically correct: public member variables) which you can change persistently in the editor. So, while using the same script for each weapon, you'd configure its exact specific behavior in the editor.
Then, you can assign those prefabs to the game object of the player during runtime (obviously, the player would have a script which has 3 properties, one representing each weapon slot; you might use an array for this; depends on what makes most sense in your specific case).
With that set up, you can simply call the "fire-method" you have defined in your weapon-script on either the object in "slot A", "slot B" or "slot C" (or weapons[0], weapons[1] or weapons[2] if you chose to use an array).
So the player script would check for the buttons pushed and then pick the according slot. Obviously, you'd probably also have to check whether a slot is actually filled (if (slotA != null) { logic for shooting } else { tell player he can't use that slot, yet }).