Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

FUCoroutine

An asset by Jamesika
The page banner background of a mountain and forest
FUCoroutine hero image

Quick Information

0 ratings
FUCoroutine icon image
Jamesika
FUCoroutine

It's just fxxking same as Unity Coroutine.

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

FUCoroutine

It's just fxxking same as Unity Coroutine.
It's a plugin for Godot Engine.

Features

StartCoroutine & StopCoroutine

public partial class ExampleNode : Node
{
    public void Example()
    {
        var coroutineHandler = CoroutineManager.StartCoroutine(CustomCoroutine());
        CoroutineManager.StopCoroutine(coroutineHandler);
    }
}

StartCoroutine & StopCoroutine from node

public partial class ExampleNode : Node
{
    public void Example()
    {
        var coroutineHandler = this.StartCoroutine(CustomCoroutine());
        this.StopCoroutine(coroutineHandler);
    }
}
  • If the node is free or remove from tree, the coroutine will be automaticlly stopped.
  • If the node is paused (GetTree().Paused = true), the coroutine will be paused, too.

Wait For XXX

public IEnumerator Example()
{
    // Same as Unity : WaitForEndOfFrame()
    yield return new WaitForEndOfProcess();
    
    // Same as Unity, Wait one frame
    yield return null;
    
    yield return new WaitForFrames(10);

    // Same as Unity :WaitForFixedUpdate()
    yield return new WaitForPhysicsProcess();

    // Same as Unity
    yield return new WaitForSeconds(1.0);

    // Same as Unity, ignore Godot.Engine.TimeScale. **but if TimeScale is zero, WaitForSecondsRealtime will be paused.**
    yield return new WaitForSecondsRealtime(1.0);

    // Same as Unity
    yield return new WaitUtil(Validate());

    // Same as Unity
    yield return new WaitWhile(Validate());
}

Custom Wait For Something

public class WaitForSomething : YieldInstruction
{
    public override bool IsComplete()
    {
        // Is it completed ?
    }
}

It's just fxxking same as Unity Coroutine.

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
FUCoroutine icon image
Jamesika
FUCoroutine

It's just fxxking same as Unity Coroutine.

Supported Engine Version
4.1
Version String
1.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