Hello there.
There is question I would like to ask more advanced developers.
I’m kind of a beginner in Unity and C#, but have successfully done the create with code tutorial and I’m really determined to learn more and more about the programming.
I am not asking for finished code, just to point me in the right direction. Working now on a personal project, I come to the realization that I have to think about the hierarchy of the scripts in my project.
What I learned is that is it usually bad experience to create dependencies between scripts, search for components and other scripts via GameObjects etc. And it is much better to use Events, EventBrokers etc. Question is how should I put all my game together.
Thing is, in my game I will have multiple Enemies, so first of all I learned about Scriptable Objects (SO next), and created a SO for the base class Enemy. It will store all the basic features of the class Enemy. Also thinking ahead I created GameObjects I will attach this SO’s and a script that will assign all the parameters from the SO to the prefab (in my case it will be a prefab for each enemy). This way I don’t need to assign them for all enemies myself.
1.) Question is for now, what would be the best way to achieve more functionality. Should I create another script which will contain the basic behavior for all enemies, and then via SO I will choose the behavior that is possible for a concrete kind of enemy. And should I create Interfaces like IKillable and IDieable to manage the basic functions that my enemies will be making?
2.) Also will it be good to create a GameMenu scene that will be loaded forever to store the menu, and a scene to store all the game interactions?
3.) What is the best way to save enemies? (Think of HOMAM3 or FF) Enemy Hero has 3 stacks of prefabs of different enemies. So should I use dictionaries to best access them? And what would be the best way to store the amount of enemies in a stack and the type of enemy. Drop Items, DamageTypes, Skills etc.
Again, I would be very thankful if you all would just point me in the right direction, I’m getting really hyped to learn all this stuff! Learning about SO itself was really awesome, and after two days I finally get it all to work in the editor, that was huge. Maybe its a long period for a so simple for someone topic, but again, all this is really new for me, and I like to work with this very much after my regular working day.
Thank you all.