Using state machines instead of coroutines
Within my Unity game I have various NPCs that do different tasks at different times. Everything is coded using coroutines as it’s all I knew when starting out. The NPC will use a coroutine to decide on a task, then execute the coroutine associated with the task, then start the ChoosingTask() coroutine again. Rinse and repeat. Everything functions as it should. My question is: is it beneficial to me to rewrite everything using a state machine? Are there performance downsides to using coroutines for everything they do? It seems much clearer from a development standpoint when using a state machine, but if everything works as it should, are there any major downsides in my method?