public static IEnumerator YieldReturn(object yieldObject, LuaFunction function) { yield return(yieldObject is IEnumerator?Behaviour.StartCoroutine((IEnumerator)yieldObject) : yieldObject); function.Call(); }