https://aalmada.github.io/posts/Behavior-tree-development-in-csharp-with-IEnumerable-and-yield/
#dotnet #csharp #unity3d
Behavior Tree Development in C# with IEnumerable and Yield
As discussed in a prior post on custom iterators with yield in C#, the combination of IEnumerable<T> and yield enables the creation of coroutines. Coroutines are commonly defined as functions capable of pausing and resuming execution. Effectively, managing these entails employing state machines, easily implemented through the use of the yield keyword. However, a challenge arises when composing multiple reusable coroutines, a problem addressed by the concept of behavior trees.
