private void Example2() { Cooperator cooperator1 = this.AsCoroutine().YieldWaitForSeconds(1f).Action(() => Debug.Log("cooperator1")); Cooperator cooperator2 = this.AsCoroutine().YieldWaitForSecondsRealtime(1f).Action(() => Debug.Log("cooperator2")); Cooperator cooperator3 = this.AsCoroutine().YieldWaitForEndOfFrame().Action(() => Debug.Log("cooperator3")); Cooperator newCooperator = Random.value < 0.5f ? cooperator1.YieldCoroutine(cooperator2) : cooperator1.YieldCoroutine(cooperator3); newCooperator.Start(this); }
private void Example1() { Cooperator cooperator1 = this.AsCoroutine().YieldWaitForSeconds(1f).Action(() => Debug.Log("cooperator1")); Cooperator cooperator2 = this.AsCoroutine().YieldWaitForSecondsRealtime(1f).Action(() => Debug.Log("cooperator2")); cooperator1.YieldCoroutine(cooperator2).Start(this); }
private void Example4() { Cooperator cooperator = this.AsCoroutine().YieldWaitForSeconds(1f); Cooperator newCooperator = cooperator.YieldCoroutine(UnityCoroutine()); newCooperator.Start(this); }