Skip to content

pplasto/New-Coroutine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewCoroutine

Let's kick out unity's bad coroutine. Please free to use.

Sample in /Assets/Scripts/Coroutine/Sample

How to use

IEnumator Foo() {
    yield return null;
}

Simple coroutine

CoroutineExecutor.Do(Foo());

Group coroutine

var group = new GroupCoroutine(Foo());
group.Add(Foo());
CoroutineExecutor.Do(group);

Order courtine

var order = new OrderCoroutine(Foo());
order.Add(Foo());
CoroutineExecutor.Do(order);

Event coroutine

// It will wait until receiving event
var ev = new EventCoroutine(new string[] {"ABC", "123"});
yield return ev;

// After some coroutine wait for event,  You can send event by this way to trigger EventCoroutine to finish. 
CoroutineExeCcutor.SendEvent("ABC");

// Then every EventCoroutine wait for "ABC" event will be finish.

Executing during FixedUpdate()

yield return BaseCoroutine.WaitFor.FixedUpdate;
or yield return new WaitForFixedUpdate();

Excuting during EndOfFrame()

yield return BaseCoroutine.WaitFor.EndOfFrame;
or yield return new WaitForEndOfFrame();

About

Kick out unity's bad coroutine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%