Imagine e.g. a 2D-platformer boss fight with one central enemy but with multiple phases. How would you program that?
I usually do that with a switch-case in the looped method ("void Update()" in Unity) and add a variable “status” which keeps track of the current action the boss is doing (moving to specific point, idle animation, circling, attack1, etc.). After a certain action is done I then change the status so that it goes into another “case”.
However I often run into the problem that the code gets to confusing over time because of the too long switch-case and …