✅ Syntax sugar for coroutines
Why can I do this
But not this?
IEnumerator WaitForSomehting() {
yield return resp.WaitResult();
Debug.Log("Wrapper res" + resp.result);
Debug.Log("Wrapper error" + resp.error);
}
SomeMonoBehaviour.Instance.StartCoroutine(WaitForSomehting);IEnumerator WaitForSomehting() {
yield return resp.WaitResult();
Debug.Log("Wrapper res" + resp.result);
Debug.Log("Wrapper error" + resp.error);
}
SomeMonoBehaviour.Instance.StartCoroutine(WaitForSomehting);But not this?
SomeMonoBehaviour.Instance.StartCoroutine(() => {
yield return resp.WaitResult();
Debug.Log("Wrapper res" + resp.result);
Debug.Log("Wrapper error" + resp.error);
});SomeMonoBehaviour.Instance.StartCoroutine(() => {
yield return resp.WaitResult();
Debug.Log("Wrapper res" + resp.result);
Debug.Log("Wrapper error" + resp.error);
});
