Closed wilg closed 10 months ago
As far as I can tell, you can neither have callbacks on transitions nor have enter, logic or exit on StateMachines. Both of these could be useful in many use cases. Would love to see pull requests implementing this, alternatively a fork.
Hi @wilg, this is a good feature proposal! I have implemented it and it is available in the recent 2.0 release.
As to @rafaeldolfe's comment, for some time UnityHFSM has been able to run custom callbacks when a state machine enters, has its logic call, or exits by using a HybridStateMachine
(instead of a regular StateMachine
). However, this feature has also been improved in 2.0.
Is there any way to run code when a particular state transition occurs? I can't see any way to add a callback to the transition or to access the previous state in an
onEnter
.