Skip to content

ReyAnthony/Sequencer

Repository files navigation

Create sequences that run asynchronously on Monobehaviors

public class DataContext
{
   public int i;
}

Action<DataContext> setToTen = (ctx) => { ctx.i = 10; Debug.Log(ctx.i); };
Action<DataContext> increment = (ctx) => { ctx.i++; Debug.Log(ctx.i); };
Func<DataContext, bool> AboveTwenty = (ctx) => ctx.i > 20;
Action<DataContext> printDone = (ctx) => { Debug.Log("Fini"); };

SequenceBuilder<DataContext>
   .Please()
       .Do(setToTen).Then()
       .Do(increment).ThenIf(AboveTwenty, loopWhileNotMet: true)
       .Do(printDone).Then()
   .ThankYou()
   .Run(this);

About

Unity sequencer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages