Hello Unity Friends!
I have a question about instantiating prefabs, and using polymorphism in my behaviors. Let’s say I have an “enemy” prefab that I am instantiating when I want to spawn enemy objects. I would like to create several behaviors that have functionality specific to the type of enemy and have the behaviors extend a base enemy behavior that has all common functionality. I’m trying to figure out if the best way is to just create a separate prefab for each enemy type and attach the appropriate behavior to each, or if I should create a base enemy prefab that I then attach the behavior to at run-time…or maybe there is another approach I’m not thinking of!? Any thoughts?
Thank you!
-Ryan