Closed santutu closed 6 months ago
This event sounds pretty useful.
On Sun, May 14, 2023, 7:11 AM santutu @.***> wrote:
I suggest to add an Active StateChanged event to StateMachine class to track the state. I took a quick look at the code, and I think it would be possible by invoking the event at StateMachine's ChangeState method. if this function is ok, I am willing to do pull request.
simple example fsm.OnActiveStateChanged += (activeState)=> Debug.Log(activeState);
— Reply to this email directly, view it on GitHub https://github.com/Inspiaaa/UnityHFSM/issues/22, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNKVBNQHX53I5EOOQE3JZTXGDRXHANCNFSM6AAAAAAYBF6IAQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi @santutu, Thanks for the feature request and the implementation of it in your pull request! I especially appreciate that you added unit tests. Thanks a lot!
I have merged your PR and made a few small changes. It will be released with the upcoming 2.1 version.
As I have not encountered a real-world use case for this feature myself, I'll be rolling out this feature conservatively, starting with a minimal version and seeing how well it fares. Future versions may then include enhancements, once I know more about how this feature is used.
+1, this feature would also be useful for my project
The "state changed" event is now available in the latest release (2.1) :+1:
Thank you! @Inspiaaa
I suggest to add an Active StateChanged event to StateMachine class to track the state. I took a quick look at the code, and I think it would be possible by invoking the event at StateMachine's ChangeState method. if this function is ok, I am willing to do pull request.
simple example fsm.OnActiveStateChanged += (activeState)=> Debug.Log(activeState);