static int LoadAsync_Lua(IntPtr L) { MonoBehaviour workerBehaviour = null; var func = (LuaFunction)lua.Lua.ValueAtInternal(L, 2); ResMgr.LoadAsync(Api.lua_tostring(L, 1), (progress, obj) => { func.Invoke(progress, obj); if (progress == 100) { func.Dispose(); } }, workerBehaviour); return(0); }