UnityHFSM icon indicating copy to clipboard operation
UnityHFSM copied to clipboard

[Feature Request] States that use tasks instead of Coroutines

Open TdXYZ opened this issue 1 year ago • 1 comments

Starting from Unity 2023.1, there is now an Awaitable class that makes it possible to use async/await functionality. It may be beneficial to add a sort of TaskState as an alternative to the CoState, as TaskStates could get around some of the limitations such as not being able to use lambdas,

TdXYZ avatar May 11 '24 19:05 TdXYZ

Hi @TdXYZ, thanks for the feature request!

I didn't know about the Awaitable feature in the latest versions of Unity. Your proposal to have a new state class that works with Awaitable is a good idea! As I'm quite close to releasing version 2.1, I'll implement it in the next version of UnityHFSM. By using C# preprocessor directives, I intend to stay compatible with older versions of Unity while also supporting the latest features. I'll keep this issue open until I have implemented it.

Inspiaaa avatar May 18 '24 18:05 Inspiaaa