Ok so I am making a sort of run n’ gun game, not dissimilar to the likes of SNK’s Metal Slug or Shock Troopers. In the game, you will do some running and gunning from point A to point B, but every so often the camera stops and you are locked onto a single screen until you kill a certain set of enemies. I will call this specific behavior an encounter. It is a lot like the phases described by Mark Brown in this video if anyone is already familiar with it.
Currently in my implementation, an encounter consists of an EncounterDirector monobehavior which tells enemies to spawn when certain conditions evaluate to true, such as a certain amount of time has elapsed since the encounter was triggered. It is hard coded and awful.
What I would like to do is change the Encounter Director to house a Serialized list of what I will call “Encounter Events” for now, which are an abstract class that has something to spawn or do such as spawning enemy soldiers or ending the encounter. Another abstract class called EncounterCondition can house conditions for these events such as waiting for a time since the encounter started to elapse, or waiting for the spawn from another encounter event to die before spawning a new enemy.
I went into detail there to try and really illustrate what I am getting at, but the real blocker is much simpler than the system as a whole. Unity doesn’t allow for abstract classes in arrays in the inspector. I also expect to see issues when I need to have a condition watch for the death of an enemy from another event as they would share the same game object. Has anyone here done this sort of thing before? What might be a more unity inspector-friendly way implement this behavior in my encounters?