You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using _statemachine.Trigger("T") will not cause a and b to perform their transitions. This unfortunately makes ParallelStates useless for statemachines that rely heavily on trigger transitions.
This can be fixed by having ParallelStates implement ITriggereable. There is however a potential issue that should be addressed. Say that statemachine "a" has some nested statemachines and statemachine "b" has a transition whose guard checks ActiveStateName of one of those nested machines. An Exception will be thrown if the nested machine is not the active state of its parent machine.
The text was updated successfully, but these errors were encountered:
Nice catch! Thanks for providing a solution in your PR.
As far as I can see, the secondary issue that you highlighted is not only limited to the Trigger method, but also to other methods that are called on sub-states that may lead to a transition, such as OnLogic.
I have implemented a solution for all these potential problems now. It checks the isActive field so that it can avoid calling certain methods after exiting.
It is already available in the release branch. For reference, I am going to keep this issue open until the next version of UnityHFSM is released.
Given the following statemachine configuration:
Using
_statemachine.Trigger("T")
will not cause a and b to perform their transitions. This unfortunately makes ParallelStates useless for statemachines that rely heavily on trigger transitions.This can be fixed by having ParallelStates implement ITriggereable. There is however a potential issue that should be addressed. Say that statemachine "a" has some nested statemachines and statemachine "b" has a transition whose guard checks ActiveStateName of one of those nested machines. An Exception will be thrown if the nested machine is not the active state of its parent machine.
The text was updated successfully, but these errors were encountered: