private void ConsecutiveCoroutineNormal() { ConsecutiveCoroutine cc = new ConsecutiveCoroutine(this); //USE DELEGATE TO ADD A FUNCTION cc.Add(delegate { ChangeTextColorInstant(Color.blue); }); //NOTHING TO ADD AN IENUMERATOR cc.Add(SetTextAndWait("1")); cc.Add(SetTextColorAndWait(Color.red)); cc.Add(SetTextAndWait("2")); cc.Add(SetTextColorAndWait(Color.blue)); cc.Invoke(); }
private IEnumerator ConsecutiveCoroutineLoop() { while (true) { ConsecutiveCoroutine cc = new ConsecutiveCoroutine(this); //USE DELEGATE TO ADD A FUNCTION cc.Add(delegate { ChangeTextColorInstant(Color.blue); }); //NOTHING TO ADD AN IENUMERATOR cc.Add(SetTextAndWait("1")); cc.Add(SetTextAndWait("2")); cc.Add(SetTextColorAndWait(Color.blue)); yield return(cc.InvokeLoop()); } }