Skip to content

oakthielbar/fluent-coroutines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fluent Coroutines

Unity3D Coroutine scheduler with a fluent interface.

Installation

Add the contents of the Asset folder to your Unity3D project's Asset folder.

Usage

Note: This was written for a fairly old version of Unity and is not suitable for production use.

Call this.FluentCoroutine() inside of any class that inherits from MonoBehaviour and chain a few calls to the available methods; once you've defined what you want the FluentCoroutine to do, call Finalize() to get the completed FluentCoroutine. When you want to run it, just call Execute() and it will run as a Unity3D Coroutine.

using UnityEngine;
using FluentCoroutines;

public class ExampleFluentCoroutine : MonoBehaviour
{
    void Start()
    {
    	this.FluentCoroutine()
            .WaitForSeconds(1f)
            .Do(PrintMessage)
            .Finalize()
            .Execute();
    }
    
    void PrintMessage()
    {
    	Debug.Log("Ahoy hoy, world!");
    }
}

About

Unity3D Coroutine scheduler with a fluent interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages