More Effective Godot Coroutines (C#)

An asset by WeaverDev
The page banner background of a mountain and forest
More Effective Godot Coroutines (C#) hero image

Quick Information

0 ratings
More Effective Godot Coroutines (C#) icon image
WeaverDev
More Effective Godot Coroutines (C#)

This asset provides Unity-style IEnumerator coroutines with zero per-frame garbage generation.

Supported Engine Version
4.0
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Description

This is a partial port of the MEC Free asset for Godot 4.x .NET published with permission under the MIT license.

Original source by Teal Rogers at Trinary Software.

Installation

  1. Download Latest commit or the stable Release version.
  2. Place the addons folder into your project root.
  3. Build the project solution under MSBuild > Build > Build Project

Usage

Documentation for the original Unity asset may be found here. Usage is largely unchanged, aside from changes to the naming conventions.

Example Coroutine

    public override void _Ready()
    {
        Timing.RunCoroutine(DestroyAfter(2));
    }

    IEnumerator<double> DestroyAfter(double seconds)
    {
        yield return Timing.WaitForSeconds(seconds);
        GD.Print("Goodbye!");
        QueueFree();
    }

Notable Differences

Doubles

Godot uses double for its scalars, so coroutines return IEnumerator<double>.

Naming

Names have been changed to match Godot terminology, most notably:

  • Update -> Process
  • GameObject -> Node

Execution order

To avoid ambiguous execution order at runtime depending on the tree layout, all Timing instances start with a ProcessPriority and ProcessPhysicsPriority of -1. This means coroutines will update before regular nodes by default.

Contribution

If you spot a bug while using this, please create an Issue.

License

MIT License

Copyright (c) 2023-present, Teal Rogers, Isar Arason (WeaverDev)

This asset provides Unity-style IEnumerator coroutines with zero per-frame garbage generation.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
More Effective Godot Coroutines (C#) icon image
WeaverDev
More Effective Godot Coroutines (C#)

This asset provides Unity-style IEnumerator coroutines with zero per-frame garbage generation.

Supported Engine Version
4.0
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers