void Foo()
{
StartCoroutine(Bar((bool myReturnValue) => {
if(myReturnValue) { ... }
});
}
IEnumerator Bar(System.Action<bool> callback)
{
yield return null;
callback(true);
}
https://discussions.unity.com/t/how-do-i-return-a-value-from-a-coroutine/6438/5
void Foo()
{
StartCoroutine(Bar("1",(bool myReturnValue) => {
if(myReturnValue) { ... }
});
}
IEnumerator Bar(string msg, System.Action<bool> callback)
{
yield return null;
callback(msg=="1");
}