Skip to content

Instantly share code, notes, and snippets.

@oleyb
oleyb / RunAsyncSequence.cs
Last active August 29, 2015 14:21
Unity3D extension method for being able to call an array of async code blocks in sequence.
public delegate float SequenceFunc();
public static void RunAsyncSequence(this MonoBehaviour obj, params SequenceFunc[] callbacks)
{
if (callbacks.Length > 0) {
obj.StartCoroutine(ExecFuncChain(callbacks));
}
}
private static IEnumerator ExecFuncChain(SequenceFunc[] callbacks)
0xfC05C304580538657219970352ece0151A3814c2