Hello all,
I have an enemy spawn script that uses an enum, I can select what enemy I want it to spawn in the drop down editor and it instantiates the prefab. The problem I’m starting to have is, there are several variables on the script that transfer over to the instantiated object such as patrol or stand in place, react to noises etc. Now I’m getting into variables that need to transfer to the enemy that are enemy specific and the amount of variables not necessary for all enemy types are cluttering up the editor a bit. I was wondering how to go about maybe having the editor only show specific variables based on what enum setting I have selected in the editor. Or if there is just a better way structure-wise I should be doing this.
I prefer a spawn system because I’m saving whether these spawns are active to a file each time the player transitions to a new scene so it’s easier to grab from a universal spawn script. I know I could use interfaces instead but I also like the idea that nothing is instantiated at all on an inactive spawn for performance reasons. Even just a general point in the right direction would help. I don’t mind doing the research if I can just get an idea of what I should be looking for.