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
Is there a reason for not implementing StateBase as an interface so states can be used as protected types such as MonoBehaviour and ScriptableObject? It seems like the only concrete part of the class is the exitTime constructor, but that seems like something that doesn't need to be. Implementing classes can simply choose to provide constructors that override that internal value or not and the interface can have a property for it.
The text was updated successfully, but these errors were encountered:
Hi @Invertex,
Thanks for the feature request! Using interfaces for states and transitions instead of common base classes generally seems like a good idea. I will consider it for future versions of UnityHFSM.
Such a change would entail significant refactoring and changes to documentation. Furthermore, the possible negative impact on performance should be carefully investigated.
Currently, it is already possible to show custom state classes in the inspector by marking them as Serializable. In the upcoming 2.1 release, the serialization error due to Time.time will be fixed, meaning that this will become a viable option.
Is there a reason for not implementing StateBase as an interface so states can be used as protected types such as MonoBehaviour and ScriptableObject? It seems like the only concrete part of the class is the exitTime constructor, but that seems like something that doesn't need to be. Implementing classes can simply choose to provide constructors that override that internal value or not and the interface can have a property for it.
The text was updated successfully, but these errors were encountered: