HCoroutines
HCoroutines is a C# library for Godot that introduces hierarchical coroutines, simplifying game logic by handling Godot-specific features like signals, tweens, and pausing. It supports async programming and offers an easy-to-use interface for increased readability and reduced boilerplate.
https://github.com/Inspiaaa/HCoroutinesPreview Images


HCoroutines: Hierarchical Coroutines in Godot (C#)
HCoroutines is a powerful C# library designed to bring the concept of hierarchical coroutines to the Godot game engine. This library helps streamline game logic development by offering an intuitive way to manage asynchronous operations and handle Godot-specific features seamlessly.
Key Features
- Hierarchical Coroutines: Organize coroutines in a parent-child relationship, allowing for easy management and automatic stopping of child coroutines when the parent is terminated.
- Godot Integration: Handles signals, tweens, and delays natively within coroutines.
-
Process Mode Control: Run coroutines in either
_Process()
or_PhysicsProcess()
frames. - Pause Mode Support: Automatically pauses coroutines when the game is paused.
- Asynchronous Programming: Native support for async/await patterns and tasks.
- Built-in Coroutine Types: Includes a variety of coroutine types for common tasks such as delays, parallel execution, and waiting for signals.
-
Coroutine Manager: HCoroutines uses a
CoroutineManager
class for running and managing coroutines.
Getting Started
Installation is straightforward, either through the Asset Library or by direct download. After installing, enable the HCoroutines plugin in the project settings to configure a global CoroutineManager
singleton automatically.
Core Concepts
The library revolves around the CoroutineBase
class, which is the base for all coroutine types, and the CoroutineManager
class. The Co
class provides static helper methods to create and run coroutines, reducing boilerplate code. HCoroutines provides mechanisms for managing delta time, pause modes, and custom coroutines, increasing flexibility in development.