Hi,
I need to write a state machine, most likely hierarchical, for enemy behavior in a game I am working on. I am unsure of how to structure this. Do I simply need methods for each state, or have a new script file for each state? Is there a good example I can follow to get myself off the ground?
There are many possible approaches and some elaborate frameworks out there, but I usually do something simple, have a coroutine for each state, all in the same script - http://drupal.technicat.com/games/unity/scripts/fsm.html