SUSMachine
SUSMachine copied to clipboard
A Simple Unity State Machine with a nice API and automatic transition support. No reflection, string names, or need to inherit anything.
makes it easy to reset & reusable
due to the fact that these state machines are independent of MonoBehaviour, users may unwittingly expect SUSMachine update functions to only be active when the creator script is active and...
probably a nullable `States?` is it possibily to return null by default when you declare a function with no returns?
Across the projects I've been using this library in, delegate instantiation costs haven't been an issue. Still, this is a possible improvement. e.g. https://devblogs.microsoft.com/dotnet/understanding-the-cost-of-csharp-delegates/#workarounds https://devblogs.microsoft.com/dotnet/understanding-the-cost-of-csharp-delegates/#comment-10168
When Unity supports newer language features like covariant returns, I will be able to simplify the codebase and improve quite a few aspects of this library. Though that will likely...
on `stateMachine.Initialize()`, add a runner mode enum that allows the user to choose where life cycle & update methods are called? - StateMachineRunner (default) - Manual - Automatic? (adds a...
add Enable/Disable functions to AutoCloser (and rename it) that tell the state machine manager to stop or resume calling the relevant update functions double check that the TimeInState counting functionality...
maybe an update func param in the transition function
so we can write `_ =>` rather than `(_, _, _) =>` or even `(_, __, ___) =>` when no discards
If I've read the docs right, we can do something like this... ```cs private StateMachine stateMachine; private void Awake() { stateMachine = new() { // ... } } ```