Based on the Bolt - Platformer tutorial but with most of the "Flow Machines" written in C# instead :)
Requires the Bolt plugin.
Unfortunately the Bolt <> C# integration isn't as nice as I'd hoped, so I don't think I would go this route in a real project.
Problems:
- Tedious to convert & forward Unity Messages or Events to Bolt's Custom Events and vice versa. Luckily it's just a (annoying) one-liner for the former, and Bolt supports calling C# script methods, which covers the latter. Except...
- Have to "Build Unit Options" every single time you add a script method you want to call from Bolt
- No way (as far as I can tell) to access the current state of a State Machine in script (so you end up duplicating state in C#, which is highly error prone).
- Bolt is "stringly typed", which makes refactors harder and leaves room for typos.
- Bolt's Variables are very powerful (and easily accessible in C#), requiring Singletons, PlayerPrefs, static classes, etc. to replicate in code. However, due to the above, I still prefer handling this stuff myself in C#.
- Bolt doesn't play nice with WebGL
- https://forum.unity.com/threads/bolt-aot-issues-with-webgl.939855/
- https://www.google.com/search?q=unity+bolt+webgl
- Plus it increases the bundle size by a lot
Tutorial assets licensed under the Unity Extension Asset license (basically, you have to go download them yourself from the Asset Store).
My code licensed under the MIT license.