Skip to content

FlowTask documentation

FlowTask is a C# library for writing game progression (screen transitions, dialogs, character behavior, cutscenes, tutorials) step by step with async/await. The structure of your code (scopes) decides how long a flow lives, how it is canceled, which game time it runs on, and how its failures are handled. The same core works on .NET, Unity, and Godot.

async FlowTask OpenShop(Shop shop)
{
using var window = shop.Open(); // closed when this flow ends, however it ends
var r = await FlowTask.Race(window.Purchased.Next(), window.Closed.Next());
if (r.TryGet0(out var item)) await Purchase(item);
}