First off, please understand I am horrendously confused with how to do things in Unity. I might not even be asking the right questions, I'll pose my problem and hope it shows my gap in knowledge.
For my game project (a clicker game), I have a several types of object for the player to interact with. Food, Training Dummies, Enemies etc. As per most games, I need objects of the similar type to have different parameters. eg. blue enemy does 1 damage, red enemy does 2. Unlike most games, I will only be showing one 'interactable' object per scene. once you defeat that enemy, it dies, you get experience and it respawns. once you've eaten the food, it vanishes and you get whatever bonus and then it restocks based on what you have in your inventory.
So, I'd made a base class Enemy (which is a unity script, right? which is just a c# class you can attach to a GameObject?)
Next step, adding my child game objects into the scene when I need them. I think this is where the confusion sets in.
So far I'd placed a GameObject in my scene, set it's layout etc and attached the enemy script to it. my respawn mechanic (for a single enemy object repeating itself) was to access the canvasgroup component and set the alpha & interactivity off and then back on, the 'new' enemy would also have it's health refilled, the total updated, all inside a single script using one class. I'm doing it in such a primitive way because I can't quite understand how to correctly create a new child object into my scene and interact with it.
if I make a c# script "BlueEnemyScript" inherit from script "EnemyScript", that's a "child object" in c#?
I create a GameObject (Blue_Enemy) and attach all the components to it including BlueEnemyScript c# script, then drag it into prefabs.
I then have another GameObject called EnemyManage that will instantiate the prefab via a script.
When I instantiate this prefab (is that a Child in Unity?), it will have it's own unique instance of BlueEnemyScript?
If I were to instantiate the non child Enemy, but change it's parameters as part of the method to instantiate it, wouldn't it have the same effect since it has a unique instance of the script?
Do I even need multiple instances because I'll only have one of the same object type active at a time? should I just swap which method inside the object script is being accessed?
Happy to have this question closed, I understand it's a mess.
I read some old questions but they haven't made it much clearer: